/// <summary>
/// 获取IP
/// </summary>
/// <returns></returns>
private string GetIp()
{
string ip = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (ip == null || ip.Length == 0 || ip.ToLower().IndexOf("unknown") > -1)
{
ip = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
}
return ip;
}
获取用户IP
最新推荐文章于 2024-09-29 10:50:09 发布