Dim WinHttpReq As Object = CreateObject("Msxml2.ServerXMLHTTP") WinHttpReq.Open("GET", "http://1212.ip138.com/ic.asp") WinHttpReq.Send '正则表达式解析出外网IP Dim str As String = WinHttpReq.ResponseText Dim mc = System.Text.RegularExpressions.Regex.Matches(str, "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+") If mc.count > 0 Then msgbox(mc(0).value) End If