Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

PlatformID Enumeration

Identifies the operating system, or platform, supported by an assembly.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Enumeration PlatformID

Member nameDescription
MacOSXThe operating system is Macintosh.
NokiaS60The operating system is the S60 Platform.
Supported by the XNA FrameworkUnixThe operating system is Unix.
Supported by the XNA FrameworkWin32NTThe operating system is Windows NT or later.
Supported by the XNA FrameworkWin32SThe operating system is Win32s. Win32s is a layer that runs on 16-bit versions of Windows to provide access to 32-bit applications.
Supported by the XNA FrameworkWin32WindowsThe operating system is Windows 95 or Windows 98.
Supported by the XNA FrameworkWinCEThe operating system is Windows CE.
Supported by the XNA FrameworkXboxThe development platform is Xbox 360.

Use the Environment.OSVersion and OperatingSystem.Platform properties to obtain the PlatformID enumeration for the currently executing operating system or development platform. Use the PlatformID enumeration to help determine whether the current operating system or development platform supports your application.

You can use the underlying integer value of each PlatformID enumeration member, as shown in the table, as the PlatformId argument for the SignTool.exe (Sign Tool) utility.

Member

Underlying value

Win32S

0

Win32Windows

1

Win32NT

2

WinCE

3

Unix

4

Xbox

5

MacOSX

6

The following example demonstrates using the PlatformID 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. 
'

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8
Show:
© 2015 Microsoft