日期:2014-05-17 浏览次数:20848 次
public static string KeHuDuanIP()
{
string e= HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(e))
{
e= HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
if (string.IsNullOrEmpty(e))
{
e= HttpContext.Current.Request.UserHostAddress;
}
return e;
}