on error resume next
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
For Each objItem in colItems
For Each objAddress in objItem.IPAddress
If objAddress <> "" then GetIP = objAddress
Next
Next
set ie=CreateObject("internetexplorer.application")
ie.navigate("http://www.ip138.com/ip2city.asp")
ie.Visible=False
While ie.busy Or ie.readystate <> 4
WEnd
Set regEx = New RegExp
regEx.Pattern ="\d.*\d"
Set Matches = regEx.Execute(ie.document.body.innerhtml)
ie.quit
For Each Match in Matches
RetStr=Match.Value
Next
msgbox "内网IP是:"&GetIP&vblf&"外网IP是:"&RetStr