复制代码 代码如下:
set oDOM = WScript.GetObject("http://ipseeker.cn//")
flag=0
for i=1 to 10
if oDOM.readyState = "complete" then
flag=1
exit for
end if
WScript.sleep 500
next
if flag=0 then
WScript.Echo "timeout ..."
wscript.quit
end if
s=oDOM.documentElement.innerText
Set Re = New RegExp
Re.Pattern="(\d+)\.(\d+)\.(\d+)\.(\d+)"
for each r in Re.Execute(s)
res=r
exit for
Next
WScript.Echo "IPAddress: " res
原文:http://www.enun.net/?p=1188
您可能感兴趣的文章:- VBS获取外网IP地址并发送到指定邮箱的代码
- 获取外网IP并发送到指定邮箱的vbs代码[已测]
- 使用vbs获得外网ip并发送到邮箱里