Home > Code > C# > Get Client IP address using Asp.Net

Get Client IP address using Asp.Net

by Shiva murugan   on May 05, 2011   Category: C#   |  Views: 1599    |  Points: 25   |  Bronze 


see the below sample code for 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>");
}




Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts