在 Windows 8.1 预览版中,Environment.OSVersion.Version 返回与 Windows 8 相同的版本号。是否有检测 Windows 8.1 的替代方法。
最佳答案
看看这篇文章:
Operating system version changes in Windows 8.1 Preview
GetVersion(Ex)
APIs have been deprecated. That means that while you can still call the APIs, if your app does not specifically target Windows 8.1 Preview, you will get Windows 8 versioning (6.2.0.0).
它说的是 GetVersion
对你说谎关于真正的操作系统版本,除非你在你的 list 中明确指示 8.1。
您需要将以下内容添加到应用程序 list 中:
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
* <!-- Windows 8.1 -->
* <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application>
</compatibility>
如果您不想这样做,您可以检查以下注册表项:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
当前版本将为您提供 6.3
当前版本号为 9431
关于windows - 如何在桌面应用程序中检测 Windows 8.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17399302/