我试图获取用户的外部IP,以便我可以将其保存到他们的用户文件。但我找不到任何办法。我试着这样做:获取外部IP
Private Function getExternalIP() As Net.IPAddress
Using wc As New Net.WebClient
Return Net.IPAddress.Parse(Encoding.ASCII.GetString(wc.DownloadData("http://whatismyip.com/automation/n09230945.asp")))
End Using
End Function
但我总是收到出现FormatException称“IP无效”
我们需要知道从什么http://whatismyip.com/automation/n09230945.asp响应样子。 –
这从2012年工作正常,因此评论 - http://www.codeproject.com/Tips/452024/Getting-the-External-IP-Address –