添加System.Management的引用,
using System.Management;
string mac = "";ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");ManagementObjectCollection moc=mc.GetInstances();foreach(ManagementObject mo in moc){ if ((bool)mo["IPEnabled"]) { mac = mo["MacAddress"].ToString(); }}
参考
http://www.cnblogs.com/diulela/archive/2012/04/07/2436111.html