When use 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
I have Windows 8.1 Professional Edition Original
like this (the messageBox is a RadMessageBox from Telerik Controls):
Why?
From the manual ;
The OSVersion property reports the same version number (6.2.0.0) for both Windows 8 and Windows 8.1.
In other words, a documented "limitation".
http://msdn.microsoft.com/en-us/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")
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.