2023-11-16 17:37:21 +01:00
|
|
|
|
// Copyright (c) Microsoft Corporation
|
|
|
|
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
|
|
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
2025-01-13 17:13:16 +02:00
|
|
|
|
namespace ManagedCommon
|
2023-11-16 17:37:21 +01:00
|
|
|
|
{
|
|
|
|
|
|
public static class OSVersionHelper
|
|
|
|
|
|
{
|
2025-01-13 17:13:16 +02:00
|
|
|
|
public static bool IsWindows10()
|
|
|
|
|
|
{
|
2026-01-14 15:56:44 +08:00
|
|
|
|
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build < 22000;
|
2025-01-13 17:13:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-16 17:37:21 +01:00
|
|
|
|
public static bool IsWindows11()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 22000;
|
|
|
|
|
|
}
|
2024-07-11 03:34:17 -07:00
|
|
|
|
|
|
|
|
|
|
public static bool IsGreaterThanWindows11_21H2()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build > 22000;
|
|
|
|
|
|
}
|
2023-11-16 17:37:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|