那里的任何人都有一个干净的Get_External_IP_Address函数? [英] Anyone out there have a clean Get_External_IP_Address function?

查看:110
本文介绍了那里的任何人都有一个干净的Get_External_IP_Address函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一个函数,它将外部ip地址作为字符串返回,以便在Microsoft Access应用程序中使用。我通过搜索google和bing来找到一个在Access / VBA中无效的答案。


谢谢。

解决方案

< blockquote>由于可以有多个外部IP地址,您是否可以进一步明确您的要求。我希望你不是在谈论你的路由器地址(网络的外部地址 - 单个家用电脑的IE)。


我猜你需要请查看Scripting库。


等网站,例如 http: //www.whatismyip.com/ 显示我的外部IP地址。我有兴趣通过访问中的vba代码抓取这个地址。


哦亲爱的。然后你的路由器的地址。至少你的帖子很清楚你在追求什么。


这个问题是这些信息既没有配置到你的机器上也不容易(或标准地 - 抱歉在那里发明信息)询问你的路由器在它的外部端口使用哪个IP地址。


这可能不是完全不可能的(有人可能会敲一些查询的代码)使用HTML界面的链接甚至处理来自其中一个网络工具(EG.TraceRt,PathPing等)的响应,但这绝不是微不足道的。这是因为你所追求的甚至与你自己没有关系PC,但是您的路由器(当然还有您的供应商的属性,但查询同样复杂)。


I need a function that returns the external ip address as a string for use inside a Microsoft Access application. My efforts to find one thru searching google and bing produce answers that do not work in Access/VBA.

Thanks.

解决方案

As there can be multiple external IP addresses, can you further clarify your requirement. I''m hoping you''re not talking about your router address (The external address for your network - IE for a single home PC).

I would guess you would need to look into the Scripting libraries for this.


sites like http://www.whatismyip.com/ display my external ip address. It is this address that I am interested in grabbing via vba code in access.


Oh dear. The address of your router then. At least your post makes it very clear what you''re after.

The problem with this is that this information is neither configured into your machine nor easily (or standardly - sorry for the word invention there) enquire of your router which IP Address it is using on its external port.

It may not be totally impossible (Someone may be able to knock up some code that enquires of the link using an HTML interface or even process the response from one of the networking tools (EG. TraceRt, PathPing, etc) but this is in no way trivial. This is because what you''re after is not even related to you own PC, but is an attribute of your router (and of your supplier of course, but that''s equally complicated to enquire).


这篇关于那里的任何人都有一个干净的Get_External_IP_Address函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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