更新时间:2023-11-27 21:52:34
你可以测试你的macaddress:
You can test your macaddress:
public bool MacAddressOk(string myMacAddress)
{
string macAddresses = "";
foreach (System.Net.NetworkInformation.NetworkInterface nic in System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces())
{
// We must consider only Ethernet network interfaces
if (nic.NetworkInterfaceType != System.Net.NetworkInformation.NetworkInterfaceType.Ethernet) continue;
if (nic.OperationalStatus == System.Net.NetworkInformation.OperationalStatus.Up)
{
macAddresses += nic.GetPhysicalAddress().ToString();
break;
}
}
if (macAddresses == myMacAddress)
return true;
else
return false;
}