62,072
社区成员
发帖
与我相关
我的任务
分享
public static string GetUserIP()
{
string User_IP;
if (HttpContext.Current.Request.ServerVariables["HTTP_VIA"] != null)
{
User_IP = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else
{
User_IP = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"].ToString();
}
return User_IP;
}