OperatingSystem.IsOSPlatform(String) 方法

定義

指出目前的應用程式是否正在指定的平台上執行。

public:
 static bool IsOSPlatform(System::String ^ platform);
public static bool IsOSPlatform (string platform);
static member IsOSPlatform : string -> bool
Public Shared Function IsOSPlatform (platform As String) As Boolean

參數

platform
String

平台名稱 (不區分大小寫)。 範例:Browser、Linux、FreeBSD、Android、iOS、macOS、tvOS、watchOS、Windows。

傳回

如果目前的應用程式是在指定的平台上執行,則為 true;否則為 false

適用於