'此函数用于获取外网IP地址
Dim WinHttpReq As Object = CreateObject("Msxml2.ServerXMLHTTP")
WinHttpReq.Open("GET", "http://www.ip138.com/ip2city.asp")
WinHttpReq.Send
'正则表达式解析出外网IP
Dim MyRegExp
MyRegExp = CreateObject("VBScript.RegExp")
MyRegExp.Pattern = "((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)"
MyRegExp.IgnoreCase = True
MyRegExp.Global = True
Dim Matches As object = MyRegExp.Execute(WinHttpReq.ResponseText)
Return Matches.Item(0).Value