我正在构建一个小型应用程序,它会在您将 IP 地址输入到屏蔽文本框中后更改它。我真的很接近弄清楚,但我需要 h = myNewIP 部分的帮助,因为我无法从 IP 地址转换为 IP 主机条目:
Public Class MainForm
Dim h As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)
Dim myNewIP As System.Net.IPAddress
Dim myIPEndPoint As System.Net.IPEndPoint
Dim strLocalIp As String
Private Sub
myNewIP = System.Net.IPAddress.Parse(TextBox1.Text)
myIPEndPoint = New System.Net.IPEndPoint(myNewIP, 0)
h = myNewIP
ipTextBox.Text = myNewIP.ToString
End Sub