Nov 21, 2002 #1 dynodave Programmer Sep 23, 2002 11 GB How do you get the IP address of a user's workstation using vb.net
Nov 25, 2002 #2 SamEvans MIS Aug 23, 2001 2 DE 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. Upvote 0 Downvote
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.
Nov 25, 2002 Thread starter #3 dynodave Programmer Sep 23, 2002 11 GB 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. Upvote 0 Downvote
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.