Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting the IP address of a user's workstation

Status
Not open for further replies.

dynodave

Programmer
Sep 23, 2002
11
GB
How do you get the IP address of a user's workstation using vb.net
 
Seems like this works. I've tried it from a web page, so it should work the same form a Windows form.

Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)

Response.Write("IP Address = " & (CType(h.AddressList.GetValue(0), System.Net.IPAddress).ToString))

Console.WriteLine will do instead of Response.Write for windows form.

 
Thanks Sam, even though it's only a couple of lines of code - you've saved me so much time as I couldn't find how to do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top