OperatingSystem.IsWindowsVersionAtLeast(Int32, Int32, Int32, Int32) 方法

定義

檢查) 所 RtlGetVersion 傳回的 Windows 版本 (是否大於或等於指定的版本。 這個方法可以用來保護在指定的 Windows 版本中新增的 API。

public static bool IsWindowsVersionAtLeast (int major, int minor = 0, int build = 0, int revision = 0);
static member IsWindowsVersionAtLeast : int * int * int * int -> bool
Public Shared Function IsWindowsVersionAtLeast (major As Integer, Optional minor As Integer = 0, Optional build As Integer = 0, Optional revision As Integer = 0) As Boolean

參數

major
Int32

主要版本號碼。

minor
Int32

次要版本號碼。

build
Int32

組建版本號碼。

revision
Int32

修訂版本號碼。

傳回

如果目前的應用程式是在 Windows 上執行,且版本至少為參數中指定的值,則為 true;否則為 false

適用於