I've create a chatting program using Winsock control. I've created two versions, one with UDP protocol and the other with TCP/IP protocol. Now I am trying to chat with a friend over the Internet with the program I created, but I don't know what to give as the "RemoteHost" value. I would need to specify the IP address of the user (or the friendly computer name which is a netBIOS name) with whom I would like to chat.
But the problem is how can I get the person's IP address? (I only know e-mail address). If not, what about the friendly name, Computer Name? Or, is there any other way I can get connected?
Well, assuming that you know at least the subnet that he's on, you could do this:
dim a as integer,b as integer,c as integer,d as integer
dim PingPacket as string
pingpacket="Ping?"
dim IP as string
ip = "127.0."
with winsock1
for c = 1 to 255
for d=1 to255
.remotehost=ip & c & "." & d
doevents
.senddata pingpacket
doevents
next d
next c
'This needs to be UDP, and it will be very fast
'You can check an EXE with a code very similar to this at http://browse.to/Darkstar
'Download Chaser
Try looking at the BOOKS ONLINE section of help and using WINSOCK as a keyword. This has an example that should provide you with the information and an example too.