NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }
NetworkInterface[] netWorks = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface netWork in netWorks) { if (netWork.Name=="本地连接") { MessageBox.Show(netWork.GetPhysicalAddress().ToString()); } }