這篇文章給大家介紹VBS中怎么獲取外網(wǎng)IP,內(nèi)容非常詳細,感興趣的小伙伴們可以參考借鑒,希望對大家能有所幫助。
代碼如下:
set oDOM = WScript.GetObject("/tupian/20230522/ 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
關于VBS中怎么獲取外網(wǎng)IP就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。