ManagementClass mc;
mc = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection moc = mc.GetInstances(); foreach (ManagementObject mo in moc) { //if (mo["IPEnabled"].ToString() == "True") // Console.WriteLine( mo["MacAddress"].ToString());if (mo["IPEnabled"].ToString() == "True")
Console.WriteLine(mo["MacAddress"].ToString()); } Console.Read();