我使用C#。我试图让操作系统的最新版本:获取C#中Windows 10的最新版本操作系统#
OperatingSystem os = Environment.OSVersion;
Version ver = os.Version;
我上的Windows 10:6.2。
但6.2是的Windows 8或的WindowsServer 2012(Detect Windows version in .net)
我发现下面的解决方案(How can I detect if my app is running on Windows 10)。
static bool IsWindows10()
{
var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion");
string productName = (string)reg.GetValue("ProductName");
return productName.StartsWith("Windows 10");
}
这是最好的方式获得在C#中的当前版本?
也许检查在这一个:http://stackoverflow.com/questions/6331826/get-os-version-friendly-name-in-c-sharp –
@olga你添加了清单+ supportedOS指导? – magicandre1981