我需要获取运行 Windows 10 IoT 的 Raspberry Pi2 的处理器序列号。
最佳答案
通常这是在 Windows.System.Profile.HardwareIdentification 命名空间内。不幸的是,这是 Win10 IoT 核心版不支持的命名空间之一。
相反,为了识别金属,我使用来自网络适配器的信息:
public static HashSet<string> NetworkIds()
{
var result = new HashSet<string>();
var networkProfiles = Windows.Networking.Connectivity.NetworkInformation.GetConnectionProfiles().ToList();
foreach (var net in networkProfiles)
{
result.Add(net.NetworkAdapter.NetworkAdapterId.ToString());
}
return result;
}
当然,这不是完全防错的,但到目前为止,这是我能看到的获得相当可靠的设备 ID 的唯一方法。
关于c# - 如何使用Windows IOT获取Raspberry PI 2的处理器序列号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33960375/