NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }
时间: 2024-12-29 11:56:53
NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }