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

问题描述 投票:10回答:4

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

c# raspberry-pi2 windows-10-iot-core windowsiot
4个回答
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;
    }

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


2
投票

我从Microsoft's IoT Sample (IoTCoreDefaultApp)中提取了一个代码示例,它可能对您提取设备信息很有帮助(遗憾的是,处理器序列号从未暴露在编程中)。

如何获取Windows IoT设备的信息:enter image description here


0
投票

使用此代码获取设备信息。

            Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation deviceInfo= new Windows.Security.ExchangeActiveSyncProvisioning.EasClientDeviceInformation();

-5
投票

序列号可以在/ proc / cpuinfo中找到

或者你可以使用Basic Bash管道,即cat / proc / cpuinfo | grep Serial | cut -d':' - f 2

© www.soinside.com 2019 - 2024. All rights reserved.