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 否则。

适用于