//方法一
HttpContext.Current.Request.UserHostAddress; 

//方法二
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

//方法三
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();

//方法四(无视代理)
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
服务端:

相关文章:

  • 2021-07-26
  • 2022-12-23
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
猜你喜欢
  • 2021-12-15
  • 2021-12-05
相关资源
相似解决方案