【发布时间】:2016-12-21 03:13:53
【问题描述】:
仍在寻找一种从 C#/UWP iot-core 应用程序中简单地获取当前操作系统版本(例如操作系统版本:10.0.14393.0)的方法。指针?如果我在网上搜索,我会得到一堆令人困惑的黑客攻击。
iot-core 的版本号非常重要,我们到处都可以找到这样的声明“此分支支持可用的最新 windows IoTCore 版本(当前 1607,版本号 10.0.14393.x)”和 windows 10 UWP设备现在进行自动操作系统更新。那么如何在运行时从设备(iot-core/UWP)获取这些信息呢?
注意:“Environment.OSVersion.Version”显然不可用,所以这不是重复发布How to get OS version number?
【问题讨论】:
-
我无法验证这一点,但您可能想通过 P/Invoke 致电 native
GetVersionExfunction。快速谷歌搜索以确认是否可以在 UWP 上执行此操作,我找到了a page that describes how to do exactly that, albeit using a different function as an example。 -
谢谢。这 (stackoverflow.com/a/31895625/1480500) 和 (stackoverflow.com/q/36462824/1480500) 似乎提供了所需的结果,但鉴于它是一个分析 API,我猜微软确实已经决定我们不需要知道这一点(因此,答案标记在下面)! ?
标签: c# uwp windows-10-universal windows-10-iot-core