HI 的 。 我赛伦德拉・辛格,任何人帮助的一些疑难问题想获得客户端的IP地址与ASP.NET(C#中)的帮助下,我怎样才能得到客户机的IP在asp.net(C#中) NBSP
NBSP NBSP提前感谢。
回答
评论会员:OriginalGriff 时间:2012/02/06
尝试:
Request.ServerVariables("REMOTE_ADDR")
或
Request.UserHostAddress
评论会员:devildx2050 时间:2012/02/06
Get users IP address
Oct 30, 2006 07:41 AM | LINK
HttpContext.Current.Request.UserHostAddress;
or
HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];
Toget the IP address of the machine andnot the proxy use the following code
HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];