asp.net获取网页客户端IP地址

第一种:Request.UserHostAddress;   //获取IP

第二种:HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

第三种是获取部署地址的IP:

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

原文地址:https://www.cnblogs.com/lushousong/p/4204072.html