/// <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-07-03 11:22:03 发布