Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

OSPlatform.Create(String) Method

Definition

Namespace:
System.Runtime.InteropServices
Assemblies:
netstandard.dll, System.Runtime.dll
Assemblies:
netstandard.dll, System.Runtime.InteropServices.RuntimeInformation.dll
Assembly:
System.Runtime.InteropServices.RuntimeInformation.dll
Assembly:
mscorlib.dll
Assembly:
netstandard.dll
Source:
OSPlatform.cs
Source:
OSPlatform.cs
Source:
OSPlatform.cs
Source:
OSPlatform.cs
Source:
OSPlatform.cs

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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
Public Shared Function Create (osPlatform As String) As OSPlatform

Parameters

osPlatform
String

The name of the platform that this instance represents.

Returns

An object that represents the osPlatform operating system.

Exceptions

osPlatform is an empty string.

osPlatform is null.

Remarks

Calling the Create method with the following strings is equivalent to retrieving the OSPlatform object from the corresponding static property:

osPlatform string OSPlatform property
"FREEBSD" OSPlatform.FreeBSD
"LINUX" OSPlatform.Linux
"OSX" OSPlatform.OSX
"WINDOWS" OSPlatform.Windows

Applies to


Feedback

Was this page helpful?