我使用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