static void Main(string[] args)
{
Console.WriteLine(GetWindowsVer("Windows 10"));
}
static bool GetWindowsVer(string targetVer)
{
var reg = Registry.LocalMachine.OpenSubKey(@"SOFTWAREMicrosoftWindows NTCurrentVersion");
string productName = (string)reg.GetValue("ProductName");
return productName.StartsWith(targetVer);
}