I assume that you want client IP:
public static string GetUserIP()
{
string ipList = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (!string.IsNullOrEmpty(ipList))
{
return ipList.Split(',')[0];
}
if (!string.IsNullOrWhiteSpace(HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]))
{
return HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
return HttpContext.Current.Request.UserHostAddress;
}