Get Client IP address using Asp.Net.

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 365
Write below code:-
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>");
}

Comments or Responses

Login to post response