如何获取ISP分配的客户端IP地址 [英] How to get client IP address assigned by ISP

查看:128
本文介绍了如何获取ISP分配的客户端IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨ASP大师,

请帮我解决我的问题。

我试图获取客户端的IP地址,但我无法做到这一点

成功。我试过了:

Request.ServerVariables(" http_user_agent")

Request.ServerVariable(" remote_addr")


但我得到类似125.1.1 *的东西


我需要什么才能获得分配给我ISP的IP地址。


我会感激您提供的任何帮助。


谢谢,Mark

解决方案

" ;麦克" < Mi ** @ nospaml.com写信息

news:uP ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
我正在尝试获取客户端的IP地址,但我无法成功获得
。我试过了:

Request.ServerVariables(" http_user_agent")

Request.ServerVariable(" remote_addr")


但我得到类似125.1.1 *的东西


我需要什么才能获得ISP分配的IP地址。



这个问题经常出现。


没有100%可靠的方法来获取客户的IP地址,原因有几个。
的原因。正如您已经发现的那样,如果客户端位于路由器后面,或者是b $ ba代理服务器,或者使用NAT,那么您将看不到他们真正的IP地址 -

没有办法解决这个问题。


另外,IP地址很容易欺骗......


由于这些原因,IP地址完全没有意义 - 即使尝试将它们用于任何有意义的事情,也没有

点...


你为什么试图获得客户的IP地址,AAMOI ......?

-

Mark Rae

ASP.NET MVP
http://www.markrae.net


感谢Mark的快速回复。

但是当我去网站 http://whatismyipaddress.com/ 确实会返回我的

正确的IP地址。还有其他网站也显示正确的IP

地址。

我们要抓住这些信息并存储一些

后续问题排查。


其他网站如何捕获它?


谢谢,Mark

Mark Rae [MVP] " < ma ** @ markNOSPAMrae.netwrote in message

news:uX ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
" Mike" < Mi ** @ nospaml.com写信息

news:uP ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
>我正在尝试获取客户端的IP地址,但我无法成功完成。我试过了:
Request.ServerVariables(" http_user_agent")
Request.ServerVariable(" remote_addr")

但我得到类似''125.1.1 *的内容''

我需要什么才能获得ISP分配的IP地址。



这个问题经常出现。


没有100%可靠的方法来获取客户的IP地址,原因有几个。
的原因。正如您已经发现的那样,如果客户端位于路由器后面,或者是b $ b或代理服务器,或者使用NAT,那么您将看不到他们真正的IP

地址 - 没有办法解决这个问题。


另外,IP地址很容易欺骗...


由于这些原因, IP地址完全没有意义 - 即使尝试将它们用于任何有意义的事情,也没有

点...


你为什么试图获得客户的IP地址,AAMOI ......?


-

Mark Rae

ASP.NET MVP
http://www.markrae.net



我写了自己的页面并把它放在我自己的域上,所以如果我去

http://www.mydomain.com/ip 它返回

连接的WAN IP。它从你连接的IP(/请求页面)的环境变量中获取它(REMOTE_ADDR)。

但是我自己编写的原因是这样的它更容易解析,我的只是

返回了IP。


史蒂文


" Mike" < Mi ** @ nospaml.com写信息

新闻:Oi ************** @ TK2MSFTNGP06.phx.gbl ...
< blockquote class =post_quotes>
感谢Mark的快速回复。

但是当我去网站时 http://whatismyipaddress.com/ 确实会返回我的

正确的IP地址。还有其他网站也显示正确的IP

地址。

我们要抓住这些信息并存储一些

后续问题排查。


其他网站如何捕获它?


谢谢,Mark


" Mark Rae [MVP]" < ma ** @ markNOSPAMrae.netwrote in message

news:uX ************** @ TK2MSFTNGP03.phx.gbl ...
< blockquote class =post_quotes>
>" Mike" < Mi ** @ nospaml.com写信息
新闻:uP ************** @ TK2MSFTNGP03.phx.gbl ...


>>我正在尝试获取客户端的IP地址,但我无法成功完成。我试过了:
Request.ServerVariables(" http_user_agent")
Request.ServerVariable(" remote_addr")

但我得到类似''125.1.1 *的内容''

我需要什么才能获得ISP分配的IP地址。


这个问题经常出现。

没有100%可靠的方法来获取客户的IP地址,有几个
原因。正如您已经发现的那样,如果客户端位于路由器,
或代理服务器之后,或者使用NAT,那么您将看不到他们真正的IP地址 - 没有办法绕过这个。

另外,IP地址很容易被欺骗......

由于这些原因,IP地址完全没有意义 - 没有
点甚至试图将它们用于任何有意义的事情......

为什么要尝试获取客户端的IP地址,AAMOI ......?

- < Mark Rae
ASP.NET MVP
http://www.markrae .net




Hi ASP Gurus,
Please help me solving my problem.
I am trying to get the clients IP address but I am not able to do it
successfully. I have tried:
Request.ServerVariables("http_user_agent")
Request.ServerVariable("remote_addr")

But I am getting something like ''125.1.1*''

What do I need to get the IP address assigned my the ISP.

I''ll appreciate any help you can provide.

Thanks, Mark

解决方案

"Mike" <Mi**@nospaml.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...

I am trying to get the client''s IP address but I am not able to do it
successfully. I have tried:
Request.ServerVariables("http_user_agent")
Request.ServerVariable("remote_addr")

But I am getting something like ''125.1.1*''

What do I need to get the IP address assigned my the ISP.

This question comes up fairly regularly.

There is no 100% reliable way to get a client''s IP address, for several
reasons. As you''ve already discovered, if the client is behind a router, or
a proxy server, or using NAT, then you won''t see their true IP address -
there is no way round this.

Also, IP addresses are laughably easy to spoof...

For these reasons, IP addresses are completely meaningless - there''s no
point in even trying to use them for anything meaningful...

Why are you trying to get the client''s IP address, AAMOI...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net


Thanks Mark for your quick response.
But when I go the website http://whatismyipaddress.com/ it does return my
correct IP address. There are other websites also which shows correct IP
address.
We are tring to capture this information and store it for some
troubleshooting later on.

How does other website caputures it?

Thanks, Mark
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uX**************@TK2MSFTNGP03.phx.gbl...

"Mike" <Mi**@nospaml.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...

>I am trying to get the client''s IP address but I am not able to do it
successfully. I have tried:
Request.ServerVariables("http_user_agent")
Request.ServerVariable("remote_addr")

But I am getting something like ''125.1.1*''

What do I need to get the IP address assigned my the ISP.


This question comes up fairly regularly.

There is no 100% reliable way to get a client''s IP address, for several
reasons. As you''ve already discovered, if the client is behind a router,
or a proxy server, or using NAT, then you won''t see their true IP
address - there is no way round this.

Also, IP addresses are laughably easy to spoof...

For these reasons, IP addresses are completely meaningless - there''s no
point in even trying to use them for anything meaningful...

Why are you trying to get the client''s IP address, AAMOI...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net



I wrote my own page and put it on my own domain, so if I go
to http://www.mydomain.com/ip it returns the WAN IP for the
connection. It gets it from the environment variable of what IP
you''re connecting from (requesting the page with), REMOTE_ADDR.
But the reason I maid my own is so it was easier to parse, mine just
returned the IP.

Steven

"Mike" <Mi**@nospaml.comwrote in message
news:Oi**************@TK2MSFTNGP06.phx.gbl...

Thanks Mark for your quick response.
But when I go the website http://whatismyipaddress.com/ it does return my
correct IP address. There are other websites also which shows correct IP
address.
We are tring to capture this information and store it for some
troubleshooting later on.

How does other website caputures it?

Thanks, Mark
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uX**************@TK2MSFTNGP03.phx.gbl...

>"Mike" <Mi**@nospaml.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...

>>I am trying to get the client''s IP address but I am not able to do it
successfully. I have tried:
Request.ServerVariables("http_user_agent")
Request.ServerVariable("remote_addr")

But I am getting something like ''125.1.1*''

What do I need to get the IP address assigned my the ISP.


This question comes up fairly regularly.

There is no 100% reliable way to get a client''s IP address, for several
reasons. As you''ve already discovered, if the client is behind a router,
or a proxy server, or using NAT, then you won''t see their true IP
address - there is no way round this.

Also, IP addresses are laughably easy to spoof...

For these reasons, IP addresses are completely meaningless - there''s no
point in even trying to use them for anything meaningful...

Why are you trying to get the client''s IP address, AAMOI...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net




这篇关于如何获取ISP分配的客户端IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆