C# OperatingSystem ServicePack

Description

OperatingSystem ServicePack gets the service pack version represented by this OperatingSystem object.

Syntax

OperatingSystem.ServicePack has the following syntax.


public string ServicePack { get; }

Example

The following code example demonstrates the ServicePack property.


using System;/*w w  w .j a  v a2s  .  c om*/

class Sample 
{
    public static void Main() 
    {
        OperatingSystem os = Environment.OSVersion;
        String sp = os.ServicePack;
        Console.WriteLine("Service pack version = \"{0}\"", sp);
    }
}

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