Get IP Address

Blake81

Well-known member
Joined
Feb 23, 2006
Messages
304
Location
Georgia, USA
Programming Experience
1-3
I'm working on the server half of my messenger program, and I need to store the usernames and IP's in a hash table on the server. How do I get the IP of the incoming connection from the server end? I thought about having the client program send it, but I'd still need to know how to get my own IP, and I thought that for users behind a router, it would probably just return the LAN IP anyway. Any suggestions? Thanks.
 
Yes, netstat -a will show all active connections in the command prompt, but is there a VB command to use on the client side that will return the client's Internet IP? Netstat wouldn't work for this, because I need the client's IP and username in a hash table to handle connections with them in my application. I'd think there should be something I can use, and it would probably be something simple like "My.IP". Thanks.
 
This way might be better, but I need to know if it's possible and how to do it.
If I have a TCPListener on the server application, is there a way to get the IP address of a new incoming connection in VB? I could set up a hash table on the server with the usernames and IPs that logs both when a new user logs in. Thanks.
 
Back
Top