11 February 2014

Get Client IP address using Asp.Net

string Getlocalhost = System.Net.Dns.GetHostName();
System.Net.IPHostEntry GetIP = System.Net.Dns.GetHostEntry(Getlocalhost);
foreach (System.Net.IPAddress IpList in GetIP.AddressList)
{
      Response.Write(IpList.ToString() + "<br>");
}


No comments:

Post a Comment