获得在C#用户计算机的IP地址 [英] Get IP address of user computer in C#
本文介绍了获得在C#用户计算机的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:结果
如何在ASP得到用户的客户端的IP地址.NET?
我在我所得到的用户谁在访问我的网站IP地址的应用程序。
我的网站托管的Go Daddy托管服务器上。
我尝试了好几种codeS(分列如下),但他们似乎不工作。
I have a application in which i have to get IP address of user who accessing my site. My site is hosted on Go Daddy hosting server. I have tried several codes(which are listed below) but it seems they are not working.
HttpContext.Current.Request.UserHostAddress.ToString();
Request.UserHostAddress.ToString();
Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
Request.ServerVariables["REMOTE_ADDR"];
HttpContext.Current.Request. Server Variables["HTTP_X_FORWARDED_FOR"];
我一直在做这个,因为最近3天,但我找不到什么好的解决办法。
这个什么好的解决办法。
I have been working on this since last 3 days but i could not find any good solution. Any good solution for this.
请帮我做到这一点。
感谢您。
推荐答案
我认为你可以使用的 Htt的prequest.UserHostAddress
这篇关于获得在C#用户计算机的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文