[英]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? 为什么?
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.