简体   繁体   中英

IN guest account in windows 8 how to determine the version of windows?

当我们从Windows 8中的来宾帐户登录并尝试查找版本时,它给出错误并与Windows 8具有相同的值。请建议一些适用于Windows 8和Windows 8.1的代码或API。

This gives you some background knowledge: How can we check if the current OS is win8 or blue

And this is what works for me:

// this might only work as long as there's no successor to Windows 8.1
public Version GetVersion()
{
   var reportedVersion = System.Environment.OSVersion.Version;
   if (reportedVersion.Major==6 && reportedVersion.Minor==2)
   {
      bool _IsWindows8Point1OrGreater = Type.GetType("Windows.UI.Xaml.Controls.Flyout, Windows.UI.Xaml, ContentType=WindowsRuntime", false) != null;
      if(_IsWindows8Point1OrGreater )
      reportedVersion = new Version(6,3); 
   }
   return reportedVersion;
}

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM