❔ Get Windows Version?
Im trying to get the current users windows version and match it to a specified one and make an if statement. How do i do that in C# ?
7 Replies
You could do
OperatingSystem.IsWindowsVersionAtLeast()
❯ Method: System.OperatingSystem.IsWindowsVersionAtLeast(Int32, Int32, Int32, Int32)
Checks if the Windows version (returned by RtlGetVersion) is greater than or equal to the specified version. This method can be used to guard APIs that were added in the specified Windows version.
React with ❌ to remove this embed.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.try 'Environment.OSVersion.Version.Major'
Environment.OSVersion Property (System)
Gets the current platform identifier and version number.
Stack Overflow
How to translate MS Windows OS version numbers into product names i...
How to translate MS Windows OS version numbers into product names?
For example, in .NET the following two properties could be used to work out that the product is MS Windows Vista Ultimate Edition...
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.