Windows 10 UAP 确定设备是否为 IoT(例如 Raspberry Pi 2) [英] Windows 10 UAP determine if device is IoT (e.g. Raspberry Pi 2)

查看:35
本文介绍了Windows 10 UAP 确定设备是否为 IoT(例如 Raspberry Pi 2)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何确定设备是否属于 IoT 系列,在我的例子中是 Raspberry Pi 2,但我不需要知道它是否是 Raspberry,只是一个 IoT 设备.

I was wondering how to determine if the device belongs to the IoT-family, in my case a Raspberry Pi 2, but I don't need to know if it is specifically a Raspberry, just an IoT device.

我尝试了以下代码:

//if(ApiInformation.IsApiContractPresent("DevicesLowLevelContract ", 1))
if (ApiInformation.IsTypePresent("Windows.Devices.Gpio"))
{
    this.InitializeSensor();
    return;
}

这两种情况在我的笔记本上都不成立,但在我的 Rasbperry Pi 上也不成立.有人有想法或知道如何正确做吗?

Both wont be true on my notebook, but wont be true as well on my Rasbperry Pi. Has someone an idea or knows how to do it right?

推荐答案

我希望这个属性

Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily

是您要查找的内容 - 在您的情况下,它应该返回类似于 "Windows.IoT" 的内容,因为当我在桌面上的通用应用程序中检查它时,它是 "Windows.Desktop",在装有 Windows 10 移动版(预览版)的手机上,它是 "Windows.Mobile".

is what you are looking for - it should return something like "Windows.IoT" in your case, since when I've checked it in universal app on desktop it was "Windows.Desktop" and on the phone with Windows 10 Mobile (preview) it was, well, "Windows.Mobile".

这篇关于Windows 10 UAP 确定设备是否为 IoT(例如 Raspberry Pi 2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆