ManagementClass objCustom1 = new ManagementClass("Win32_NetworkAdapterConfiguration"); ManagementObjectCollection objCustom2 = objCustom1.GetInstances(); string strMac = string.Empty; foreach (ManagementObject objCustom3 in objCustom2) { if ((bool)objCustom3["IPEnabled"] == true) { strMac = objCustom3["MacAddress"].ToString().Replace(':','-'); } } MessageBox.Show(strMac);