Using the bellow code .
protected string GetUserIP()
{
string strUserIP = string.Empty;
if (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] != null)
{
strUserIP = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else if (HttpContext.Current.Request.UserHostAddress.Length != 0)
{
strUserIP = HttpContext.Current.Request.UserHostAddress;
}
return strUserIP;
}
i get the IPaddress like the format ::1 .
How do I get the correct IP address of a system.