请教获取I访问者的IP
string ip = Request.ServerVariables["REMOTE_HOST"];我这样写得到的Ip是127.0.0.1
我想获得机的,该怎么办???
比如说获得我的本机Ip,是192.168.0.21
System.Net.IPAddress ip = System.Net.IPAddress.Parse(Request.UserHostAddress);
System.Net.IPHostEntry ihe = System.Net.Dns.GetHostEntry(ip);
tbxComputerName.Text = ihe.HostName;//主机名