当前位置: 代码迷 >> ASP.NET >> 怎么获得客户端内网IP
  详细解决方案

怎么获得客户端内网IP

热度:3783   发布时间:2013-02-26 00:00:00.0
如何获得客户端内网IP
获得它的公网IP我知道
Request.UserHostAddress
如何获得客户机的内网IP?

像我上网后公网IP是218.xxx.xx.xx
我的内网IP是192.168.1.222
要如何获得这个内网IP?

------解决方案--------------------------------------------------------
try

if(Request.ServerVariables[ "HTTP_VIA "]!=null)
{
ClientIP=Request.ServerVariables[ "HTTP_X_FORWARDED_FOR "].ToString();
}
  相关解决方案