Sorry, from your question, it's not clear how you connected two applications. It can be done on different levels of networking, or even via IPC unrelated to networks.
Please see my past answers:
Communication b/w two Windows applications on LAN.[
^],
how i can send byte[] to other pc[
^].
You can find all relevant information on MDSN. From my answers, you should see what to look for.
An adequate form of the server-side application would be a Windows Service. Please see:
Services (Windows)[
^],
Introduction to Windows Service Applications[
^],
Walkthrough: Creating a Windows Service Application in the Component Designer[
^].
[EDIT, after the clarifications from the inquirer:]
Thank you for the clarifications. First of all, let's look at this line:
client.Connect("localhost", 2020, "Jack");
Apparently, this line is only good in the server part is on the localhost, that is, it cannot be in a different host (computer). To connect to an application on a different computer, it should be connected to the same network; and you need to pass the IP address instead of "localhost".
You never mentioned that you modified your code to make the IP address you connect to configurable. The IP address should come from configuration data.
—SA