win7系统,IIS6.0
使用Request.ServerVariables["Remote_Addr"] 总得到 ::1
网络连接中 IP6的协议已勾掉,求解,如何获得本机 IP
------解决方案--------------------
win7获取的是ipv6
string clientIP = string.Empty;
clientIP = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
if (string.IsNullOrEmpty(clientIP))
clientIP = Request.ServerVariables["HTTP_X_REAL_IP"];
if (string.IsNullOrEmpty(clientIP))
clientIP = Request.ServerVariables["REMOTE_ADDR"];
return clientIP;