Get an OperatingSystem object that contains the current platform identifier and version number in CSharp

Description

The following code shows how to get an OperatingSystem object that contains the current platform identifier and version number.

Example


// w  ww. j  a  v  a  2 s  .  c om
using System;

class Sample 
{
    public static void Main() 
    {
       Console.WriteLine("OSVersion: {0}", Environment.OSVersion.ToString());
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Development »




Console
Encoding
Environment
Random