当我们从Windows 8中的来宾帐户登录并尝试查找版本时,它会给出错误和与Windows 8相同的值。请建议一些适用于Windows 8和Windows 8.1的代码或API
答案 0 :(得分:0)
这为您提供了一些背景知识: How can we check if the current OS is win8 or blue
这对我有用:
// 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;
}