Dim IPAdress As System.Net.IPAddress Dim HostName As String HostName = System.Net.Dns.GetHostName '获得本机的机器名 IPAdress = System.Net.Dns.GetHostByName(HostName).AddressList.GetValue(0) '获得本机的IP messagebox.show(IPAdress.Tostring) '获得MAC地址 msgbox(HostName)