第一种:只拿到纯数字的
'获取物理地址
Dim strMacAddress As String = String.Empty
Dim nics() As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()
strMacAddress = nics(0).GetPhysicalAddress.ToString
第二种:中间有连接符号
'获取物理地址
Dim macs As List(Of String) = New List(Of String)
Dim startInfo As ProcessStartInfo = New ProcessStartInfo("ipconfig", "/all")
startInfo.UseShellExecute = False
startInfo.RedirectStandardInput = True
startInfo.RedirectStandardOutput = True
startInfo.RedirectStandardError = True
startInfo.CreateNoWindow = True
Dim p As Process = Process.Start(startInfo) '截取输出流
Dim reader As StreamReader = p.StandardOutput
Dim line As String &