C# OperatingSystem OperatingSystem

Description

OperatingSystem OperatingSystem initializes a new instance of the OperatingSystem class, using the specified platform identifier value and version object.

Syntax

OperatingSystem.OperatingSystem has the following syntax.


public OperatingSystem(
  PlatformID platform,
  Version version
)

Parameters

OperatingSystem.OperatingSystem has the following parameters.

  • platform - One of the PlatformID values that indicates the operating system platform.
  • version - A Version object that indicates the version of the operating system.

Example

The following code example creates objects of the OperatingSystem class with selected values for the Platform and Version properties.


/*from  ww w. java  2 s  .c o  m*/
using System;

class OpSysConstructDemo 
{
    // Create and display an OperatingSystem object. 
    static void BuildOSObj( PlatformID pID, Version ver )
    {
        OperatingSystem os = new OperatingSystem( pID, ver );

        Console.WriteLine( "   {0}", os.ToString( ) );
    }
    public static void Main( ) 
    {
        Version verNull     = new Version( );
        Version verMajMin   = new Version( 3, 11 );

        // All PlatformID members are shown here.
        BuildOSObj( PlatformID.Win32NT, verNull );
        BuildOSObj( PlatformID.Win32S, verMajMin );

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version