加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

如何在桌面应用程序中检测Windows 8.1

发布时间:2020-12-13 20:12:22 所属栏目:Windows 来源:网络整理
导读:在 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
在 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是关于真正的操作系统版本,除非你明确地指示8.1在你的清单.

您需要将以下内容添加到应用程序清单中:

<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_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion

当前版本会给你6.3

当前构建nmber将为9431

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读