本文介绍了获得在C#用户计算机的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:结果
  

我在我所得到的用户谁在访问我的网站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.

请帮我做到这一点。

感谢您。

推荐答案

我认为你可以使用的

这篇关于获得在C#用户计算机的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 15:59
查看更多