public static List<string> GetMacAddress()
{
var list = new List<string>();
foreach (NetworkInterface networkInterface in NetworkInterface.GetAllNetworkInterfaces())
{
if (networkInterface.NetworkInterfaceType == NetworkInterfaceType.Ethernet)//&& networkInterface.OperationalStatus == OperationalStatus.Up)
{
if (networkInterface.GetPhysicalAddress().ToString().Length > 11 && !networkInterface.GetPhysicalAddress().ToString().Contains("00000000000000"))
{
list.Add(networkInterface.GetPhysicalAddress().ToString());
}
}
}
list.RemoveAll(item => string.IsNullOrEmpty(item));
return list;
}