C# OperatingSystem VersionString

Description

OperatingSystem VersionString gets the concatenated string representation of the platform identifier, version, and service pack that are currently installed on the operating system.

Syntax

OperatingSystem.VersionString has the following syntax.


public string VersionString { get; }

Example

The following code example demonstrates the VersionString property.


//from ww  w  .j av  a  2s .c  o m

using System;

class Sample 
{
    public static void Main() 
    {
        OperatingSystem os = Environment.OSVersion;
        Console.WriteLine("This operating system is {0}", os.VersionString);
    }
}

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