public static void DisplayTypeAndAddress(){IPGlobalProperties computerProperties = IPGlobalProperties.GetIPGlobalProperties();NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();Console.WriteLine(\"Interface information for {0}.{1}     \",computerProperties.HostName, computerProperties.DomainName);foreach (NetworkInterface adapter in nics){IPInterfaceProperties properties = adapter.GetIPProperties();Console.WriteLine(adapter.Description);Console.WriteLine(String.Empty.PadLeft(adapter.Description.Length,\'=\'));Console.WriteLine(\"  Interface type .......................... : {0}\", adapter.NetworkInterfaceType);Console.WriteLine(\"  Physical Address ........................ : {0}\",adapter.GetPhysicalAddress().ToString());Console.WriteLine(\"  Is receive only.......................... : {0}\", adapter.IsReceiveOnly);Console.WriteLine(\"  Multicast................................ : {0}\", adapter.SupportsMulticast);Console.WriteLine();}}}
相关链接:
NetworkInterface.NetworkInterfaceType 属性 (System.Net.NetworkInformation) | Microsoft Docs
爱站程序员基地
![(原创)[C#] 一步一步自定义拖拽(Drag&Drop)时的鼠标效果:(一)基本原理及基本实现-爱站程序员基地](https://aiznh.com/wp-content/uploads/2022/07/20220721231016-62d9dcd85c40b-220x150.gif)

