标签:
第一种: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();
标签:
原文地址:http://www.cnblogs.com/lushousong/p/4204072.html