hi all,
how to Get country, state, zip code and Latitude and Longitude from an ip address?
Thanks,
kk
hi all,
how to Get country, state, zip code and Latitude and Longitude from an ip address?
Thanks,
kk
hey ddanbe,
what is this?
thanks.
finally i got solution.
http://codingresolved.com/discussion/1117/get-location-of-visitor-from-ip-address/p1[^]
but how can i get ISP ip address?
thanks.
To get the IP address of a visitor (ASP.NET):
protected string GetIPAddress()
{
System.Web.HttpContext context = System.Web.HttpContext.Current;
string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipAddress))
{
string[] addresses = ipAddress.Split(',');
if (addresses.Length != 0)
{
return addresses[0];
}
}
return context.Request.ServerVariables["REMOTE_ADDR"];
}
To get local IP address:
public string LocalIPAddress()
{
IPHostEntry host;
string localIP = "";
host = Dns.GetHostEntry(Dns.GetHostName());
foreach (IPAddress ip in host.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
localIP = ip.ToString();
break;
}
}
return localIP;
}
thanks Anthony21 for the reply.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.