string user_IP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_REFERER"];
//页面的url
string nowUrl = HttpContext.Current.Request.Url.ToString();
//获得客户端的IP
string result = String.Empty;
if (string.IsNullOrEmpty(result))
{
result = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
if (string.IsNullOrEmpty(result))
{
result = HttpContext.Current.Request.UserHostAddress;
}
if (null == result || result == String.Empty)
{
result = HttpContext.Current.Request.UserHostAddress;
}
服务器发送string user_IP = System.Web.HttpContext.Current.Request.ServerVariables["HTTP_REFERER"];