我试图将我的外部 IP 放在标签中,所以我正在根据站点下载结果,但是当我通过 VPN 更改我的 IP 时,应用程序崩溃了,我相信这是因为它没有检查它是否正在获取绳子下来,他试过了。
在表单加载...
If Label1.Text = LastIp Then
Try
Dim wc As New WebClient
Label1.Text = wc.DownloadString("http://icanhazip.com/")
If you can not then
Label.Text = "Failed to get IP"
End if
End If
形式...