NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }
时间: 2024-10-13 20:58:05
NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }