OSPlatform.Create(String) 方法

定义

创建一个新的 OSPlatform 实例。Creates a new OSPlatform instance.

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

参数

osPlatform
String

此实例表示的平台的名称。The name of the platform that this instance represents.

返回

表示 osPlatform 操作系统的对象。An object that represents the osPlatform operating system.

例外

osPlatform 是一个空字符串。osPlatform is an empty string.

osPlatformnullosPlatform is null.

注解

用以下字符串调用 Create 方法等效于从相应的静态属性中检索 OSPlatform 对象:Calling the Create method with the following strings is equivalent to retrieving the OSPlatform object from the corresponding static property:

osPlatform 字符串osPlatform string OSPlatform 属性OSPlatform property
FREEBSD"FREEBSD" OSPlatform.FreeBSD
LINUX"LINUX" OSPlatform.Linux
OSX"OSX" OSPlatform.OSX
WINDOWS"WINDOWS" OSPlatform.Windows

适用于