How to connect to remote computer by LAN
Hello
In VB6, I was connecting to another computer by LAN using Microsoft Winsock Control and I was making conversations between computers.
Is there better way to do it in VB2005?
Thanks
Hello
In VB6, I was connecting to another computer by LAN using Microsoft Winsock Control and I was making conversations between computers.
Is there better way to do it in VB2005?
Thanks
well it depends what you were doing but since you referenced WinSock control, I would think you need to use the .NET managed way of communication using the Socket/TCPClient/TCPListener classes.
http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcpclient(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcplistener(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.net.sockets.socket(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/system.net.sockets.networkstream(VS.80).aspx
I hope these will get you started, as well as the forums!
I want to do it by IPs.
I mean I want to send a word then the other receives it.
Example:
I have two computer, IP of the first is "192.168.0.1" and the second is "192.168.0.2"
I want IP1 to send a word to IP2 and the conversely.
How can I do it?
See this Thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=871666&SiteID=1
It has the simples working example of Client and server in C# however you can convert it to VB.Net very easily, create two Console Applications and use one Server and one Client and put the code appropriately. You just need to change this line to put your own IP:
client.Connect(IPAddress.Parse("210.2.164.223"), port);
First run the server and then the client. And see what happens.
I hope this will help!
Best Regards,
Rizwan