【发布时间】:2017-11-21 03:43:22
【问题描述】:
我是用这个方法来获取mac地址的:
public static string GetMACAddress()
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
//for each j you can get the MAC
PhysicalAddress address = nics[0].GetPhysicalAddress();
byte[] bytes = address.GetAddressBytes();
string macAddress = "";
for (int i = 0; i < bytes.Length; i++)
{
macAddress += bytes[i].ToString("X2");
if (i != bytes.Length - 1)
{
macAddress += "-";
}
}
return macAddress;
}
我正在保存第一个结果,然后我每次都继续调用此方法并将其与第一个方法进行比较,以查看它是否被更改,从而得出其被欺骗的结果。
但如果 mac 地址已经被欺骗,这将不起作用。
即使被欺骗,我如何才能获得原始的mac地址?
【问题讨论】:
-
简短回答:你不能。请参阅this question 了解唯一标识设备的替代方案。
标签: c#