Код:
public static string GetWindowsVersion()
{
string sWindowsVersion = "";
string sQuery = "SELECT * FROM Win32_OperatingSystem";
ManagementObjectSearcher oManagementObjectSearcher = new ManagementObjectSearcher(sQuery);
foreach (ManagementObject oManagementObject in oManagementObjectSearcher.Get())
{
sWindowsVersion = string.Format("{0}| {1}", (string)oManagementObject["Caption"], (string)oManagementObject["OSArchitecture"]);
}
return (sWindowsVersion);
}