Identifies the operating system, or platform, supported by an assembly.
Assembly: mscorlib (in mscorlib.dll)
|The operating system is Macintosh.|
|The operating system is the S60 Platform.|
|The operating system is Unix.|
|The operating system is Windows NT or later.|
|The operating system is Win32s. Win32s is a layer that runs on 16-bit versions of Windows to provide access to 32-bit applications.|
|The operating system is Windows 95 or Windows 98.|
|The operating system is Windows CE.|
|The development platform is Xbox 360.|
Use the Environment.OSVersion and OperatingSystem.Platform properties to obtain the enumeration for the currently executing operating system or development platform. Use the enumeration to help determine whether the current operating system or development platform supports your application.
You can use the underlying integer value of each enumeration member, as shown in the table, as the PlatformId argument for the SignTool.exe (Sign Tool) utility.
The following example demonstrates using the class to identify the currently executing operating system.
' This example demonstrates the PlatformID enumeration. Imports System Class Sample Public Shared Sub Main() Dim msg1 As String = "This is a Windows operating system." Dim msg2 As String = "This is a Unix operating system." Dim msg3 As String = "ERROR: This platform identifier is invalid." ' Assume this example is run on a Windows operating system. Dim os As OperatingSystem = Environment.OSVersion Dim pid As PlatformID = os.Platform Select Case pid Case PlatformID.Win32NT, PlatformID.Win32S, _ PlatformID.Win32Windows, PlatformID.WinCE Console.WriteLine(msg1) Case PlatformID.Unix Console.WriteLine(msg2) Case Else Console.WriteLine(msg3) End Select End Sub 'Main End Class 'Sample ' 'This example produces the following results: ' 'This is a Windows operating system. '
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.