according to the official MSDN link, a version number is defined for each version of Windows there. in dot net, this can be read using the Environment.OSVersion object.
Console.WriteLine("OSVersion: {0}", Environment.OSVersion);
What you are looking for is called ReleaseID, not the window version. this can be read from the registry key:
HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ ReleaseId
using Microsoft.Win32; string releaseId = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", "ReleaseId", "").ToString(); Console.WriteLine(releaseId);
Stavm source share