I\'m looking for a means to detect if my C# app is running on Windows 10.
I had hoped that Environment.OSVersion would do the trick, but this seems to r
Try this one:
string subKey = @"SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion";
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine;
Microsoft.Win32.RegistryKey skey = key.OpenSubKey(subKey);
string name = skey.GetValue("ProductName").ToString();
and then you can just use an if clause:
if(name.Contains("Windows 10"))
{
//... procedures
}
else
{
//... procedures
}