Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows version in c# [duplicate]

I want to know which Windows version the PC has.. in C# Framework 3.5

I have tried using

OperatingSystem os = Environment.OSVersion;

Version ver = os.Version;

But the result is

Plataform: WIN32NT

version 6.2.9200

Version minor: 2

Version Major: 6

The problem is that I have "Windows 8 Pro"...

How can I detect it?

Thanks

like image 283
Diego Avatar asked Feb 12 '14 19:02

Diego


People also ask

How can I tell what version of Windows is on my C drive?

Start it up. Under the tools menu, select >> load hive. It then shows all your drives, select the windows folder of the drive in question. It instantly provides the version and keys.

What is window and its version?

Windows is a graphical operating system developed by Microsoft. It allows users to view and store files, run the software, play games, watch videos, and provides a way to connect to the internet. It was released for both home computing and professional works. Microsoft introduced the first version as 1.0.

What is the current Windows version number?

Version 21H1 (May 2021 Update) The Windows 10 May 2021 Update (codenamed "21H1") is the twelfth stable build for Windows 10. It carries the build number 10.0.19043.


1 Answers

You will have to match version numbers with the appropriate string value yourself.

Here is a list of the most recent Windows OS and their corresponding version number:

  • Windows Server 2016 & 2019 - 10.0*
  • Windows 10 - 10.0*
  • Windows 8.1 - 6.3*
  • Windows Server 2012 R2 - 6.3*
  • Windows 8 - 6.2
  • Windows Server 2012 - 6.2
  • Windows 7 - 6.1
  • Windows Server 2008 R2 - 6.1
  • Windows Server 2008 - 6.0
  • Windows Vista - 6.0
  • Windows Server 2003 R2 - 5.2
  • Windows Server 2003 - 5.2
  • Windows XP 64-Bit Edition - 5.2
  • Windows XP - 5.1
  • Windows 2000 - 5.0

*For applications that have been manifested for Windows 8.1 or 10. Applications not manifested for 8.1 / 10 will return the Windows 8 OS version value (6.2).

Here's the source.

Also, from the same source:

Identifying the current operating system is usually not the best way to determine whether a particular operating system feature is present. This is because the operating system may have had new features added in a redistributable DLL. Rather than using the Version API Helper functions to determine the operating system platform or version number, test for the presence of the feature itself.

like image 63
Crono Avatar answered Oct 14 '22 15:10

Crono