【发布时间】:2010-12-19 08:07:47
【问题描述】:
我要获取的是来自包含信息的网页的 IP 地址。 示例页面:http://www.game-monitor.com 我基本上是在寻找如何让 vb.net 访问该网页并保存它从该网页获得的 IP 地址。 谢谢!
【问题讨论】:
我要获取的是来自包含信息的网页的 IP 地址。 示例页面:http://www.game-monitor.com 我基本上是在寻找如何让 vb.net 访问该网页并保存它从该网页获得的 IP 地址。 谢谢!
【问题讨论】:
检查 Ping 方法的 System.Net.NetworkInformation。您可以 ping 主机名并将 IP 返回给变量。
Dim ping as Ping = New Ping()
Dim pingReply as PingReply = ping.send("www.game-monitor.com")
Dim ip as String = PingReply.Address.ToString()
编辑,您可能需要添加一个 try catch 以防 ping 没有得到回复。
【讨论】:
the IP Addresses it gets from that webpage 这意味着他需要一些网络咨询。
runat="server"添加到它存储的元素中,并尝试获取值服务器端。这个网站是你的吗?如果不是,唯一的其他方法是网站是否在 API 或某种类型的 WebService 中提供地址。