private List<string> GetMac()
{
List<string> macs = new List<string>();
try
{
var mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
var moc = mc.GetInstances();
foreach (var mo in moc)
{
if (!(bool)mo["IPEnabled"])
continue;
var mac = mo["MacAddress"].ToString();
macs.Add(mac);
}
}
catch
{
}
return macs;
}