如何使用Windows IOT获取Raspberry PI 2的处理器序列号

Jua*_*lez 10 c# raspberry-pi2 windows-10-iot-core windowsiot

我需要获取运行Windows 10 IoT的Raspberry Pi2的处理器序列号.

Obj*_*ype 11

通常,这位于Windows.System.Profile.HardwareIdentification名称空间内.不幸的是,这是Win10 IoT Core不受支持的名称空间之一.

相反,为了识别金属,我正在使用来自网络适配器的信息:

    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;
    }
Run Code Online (Sandbox Code Playgroud)

当然,这不是完全防错的,但到目前为止,我能看到获得相当可靠的设备ID的唯一方法.