如何使用 VB.NET 获取计算机的名称和 IP 地址?

问题描述:

如何通过使用 vb.net 编码发送 mac ip 地址作为输入来获取系统的 ip 地址?

How can i get ip address of system by sending mac ip address as input using vb.net coding?

Use the My Class :)

Use the My Class :)

My.Computer.Name

至于IP地址快速google搜索

as for the IP address quick google search

Private Sub GetIPAddress()

Dim strHostName As String

Dim strIPAddress As String



strHostName = System.Net.Dns.GetHostName()

strIPAddress = System.Net.Dns.GetHostByName(strHostName).AddressList(0).ToString()


MessageBox.Show("Host Name: " & strHostName & "; IP Address: " & strIPAddress)

End Sub