HttpContext.Current.Request.UserHostAddress
------------------------------------------------------------------------------------------------
通过代理,获取真实的ip
if(Context.Request.ServerVariables["HTTP_VIA"]!=null)
{
ip=Context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"].ToString();
}
else
{
ip=Context.Request.ServerVariables["REMOTE_ADDR"].ToString();
}

 

相关文章:

  • 2021-11-30
  • 2021-06-20
  • 2021-12-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案