Dim adapters() As System.Net.NetworkInformation.NetworkInterface = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces()
For Each adapter As System.Net.NetworkInformation.NetworkInterface In adapters
Output.Show("描述:" & adapter.Description)
Output.Show("标识符:" & adapter.Id)
Output.Show("名称:" & adapter.Name)
Output.Show("类型:" & adapter.NetworkInterfaceType)
Output.Show("速度:" & adapter.Speed * 0.001 * 0.001 & "M")
Output.Show("操作状态:" & adapter.OperationalStatus)
Output.Show("MAC 地址:" & adapter.GetPhysicalAddress().Tostring)
Dim ipp = adapter.GetIPProperties().UnicastAddresses
For Each ip As System.Net.NetworkInformation.UnicastIPAddressInformation In ipp
If ip.Address.AddressFamily = System.Net.Sockets.AddressFamily.InterNetwork
Output.Show("IP 地址: " & ip.Address.ToString())
Exit For
End If
Next
Next
操作状态为1的就是活动的网卡