OSPlatform.Create(String) 方法

定義

建立新的 OSPlatform 執行個體。

public:
 static System::Runtime::InteropServices::OSPlatform Create(System::String ^ osPlatform);
public static System.Runtime.InteropServices.OSPlatform Create (string osPlatform);
static member Create : string -> System.Runtime.InteropServices.OSPlatform
Public Shared Function Create (osPlatform As String) As OSPlatform

參數

osPlatform
String

此執行個體代表的平台名稱。

傳回

表示 osPlatform 作業系統的物件。

例外狀況

osPlatform 為空字串。

osPlatformnull

備註

Create使用下列字串呼叫 方法相當於從對應的靜態屬性擷取 OSPlatform 物件:

osPlatform 字串 OSPlatform 屬性
「FREEBSD」 OSPlatform.FreeBSD
「LINUX」 OSPlatform.Linux
「OSX」 OSPlatform.OSX
「WINDOWS」 OSPlatform.Windows

適用於