我建立一个小的应用程序,你将它输入一个掩码文本框后,将改变你的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