Hi there!
Abstract VB offers code for finding your local IP address:
"To find your IP address we first ask for your machine name, then we
pass that to the GetHostName function that gives us a valid
IPHostEntry object. This object contains your IP address in the
AddressList array, so we just dump the value to the console.
Dim h As System.Net.IPHostEntry =
System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName)
Console.WriteLine(CType(h.AddressList.GetValue(0),
IPAddress).ToString) "
Find your IP Address
http://abstractvb.com/code.asp?A=1038
Instructions for obtaining a visitor's IP address follow:
"There are two server variables of interest; REMOTE_ADDR and
HTTP_X_FORWARDED_FOR. As many visitors access the internet via a third
party (ie their ISP), REMOTE_ADDR does not always contain their IP
address... it contains their ISP's address. If this is the case, most
browsers then store the users IP address in the HTTP_X_FORWARDED_FOR
variable. So, first, we check HTTP_X_FORWARDED_FOR, and then if that
is empty, we try REMOTE_ADDR instead:
Dim sIPAddress
sIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If sIPAddress="" Then sIPAddress =
Request.ServerVariables("REMOTE_ADDR") "
Get the visitor's IP address
http://www.developerfusion.com/show/1626/
Hope that helps!
--Missy
Search terms: [ "VB.NET" "IP address" ] |