1、你可以试试这个事件
http://www.foxtable.com/webhelp/scr/2710.htm
2、如果你希望获取外网ip,参考
Dim WinHttpReq As Object = CreateObject("Msxml2.ServerXMLHTTP")
WinHttpReq.Open("GET", "http://2018.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
Return mc(0).value
Else
Return Nothing
End If