简体   繁体   English

为什么OS.Version报告适用于Windows 8.1的Windows 8.0?

[英]Why OS.Version reports Windows 8.0 for Windows 8.1?

When use Environment.OSVersion.Version.ToString(); 使用Environment.OSVersion.Version.ToString(); on this mode 在这种模式下

MessageBox.Show(Environment.OSVersion.Version.ToString()); show the value 6.2 when use ver command on CMD return 6.3 在CMD上使用ver命令返回6.3时显示值6.2

I have Windows 8.1 Professional Edition Original 我有Windows 8.1专业版原始版

like this (the messageBox is a RadMessageBox from Telerik Controls): 像这样(messageBox是Telerik Controls的RadMessageBox): 在此处输入图片说明

Why? 为什么?

This is a feature , not a bug. 这是一个功能 ,而不是错误。 It is because Windows 8.1 will only report the version as 6.3 to applications which have been specifically targeted to that platform. 这是因为Windows 8.1只会将版本6.3报告给专门针对该平台的应用程序。

See here and here for official documentation. 有关官方文档,请参见此处此处

From the manual ; 手册 ;

The OSVersion property reports the same version number (6.2.0.0) for both Windows 8 and Windows 8.1. 对于Windows 8和Windows 8.1,OSVersion属性报告相同的版本号(6.2.0.0)。

In other words, a documented "limitation". 换句话说,有文件记载的“限制”。

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx http://msdn.microsoft.com/zh-CN/library/windows/desktop/ms724832(v=vs.85).aspx

If you look here you find that it depends on the manifest of your application. 如果您在这里查看,您会发现它取决于您的应用程序清单。 Look at the star point :) 看星星点:)

I have used this method! 我用过这种方法!

RegistryKey key2 = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "");
                RegistryKey subkey2 = key2.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion");
                string value = subkey2.GetValue("CurrentVersion").ToString();
                if (value == "6.3")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows 8.1版本未提升时返回6.2(Win 8.0),但提升时返回6.3(Win 8.1)。 为什么? - Windows 8.1 version returned as 6.2 (Win 8.0) when not elevated, but 6.3 (Win 8.1) when elevated. Why? Windows 8.1操作系统版本和其他设备信息 - Windows 8.1 Os version and other device info Windows Phone 8.0到Windows Phone 8.1应用程序 - Windows Phone 8.0 To Windows Phone 8.1 App 如何以编程方式检测 Windows Phone 8.1 操作系统版本? - How to detect Windows Phone 8.1 OS version programmatically? Windows Phone 8.0 DLL是否与Windows Phone 8.1应用程序兼容? - Are Windows Phone 8.0 DLLs compatible with Windows Phone 8.1 apps? 为什么我无法在带有Windows 8.1的Visual Studio C#Pro 2012上运行Windows 8.0电话仿真器? - Why i cant run windows 8.0 phone emulator on my visual studio c# pro 2012 with windows 8.1? 这可以在Windows Phone 8.0 / 8.1中开发Call Blocker应用程序吗? - is this possible to develop Call Blocker app in Windows Phone 8.0/8.1? 如何使用XAML在Windows Phone 8.0 / 8.1上创建带有纹理的背景 - How to create a background with a texture on Windows Phone 8.0/8.1 using XAML C#获取操作系统名称Windows 8.1 - C# Get OS Name Windows 8.1 如何在Windows Phone 8.1中检测操作系统语言 - How to detect OS language in Windows Phone 8.1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM