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

[211 byte] By [onh1986] at [2007-12-26]
# 1

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!

ahmedilyas at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 2

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?

onh1986 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 3
the examples shown in the links given can achieve this :-) of course you need to have a client/server app going on, again as shown/demo'd in the doc's in order to send and recieve data
ahmedilyas at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 4

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

RizwanSharp at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...
# 5

Can I do in one project?

Why does it need two projects (Server and Client)?

onh1986 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Networking and Communication...

.NET Development

Site Classified