The source code to get the Operating System version of computer using Environment class is given below. The given program is compiled and executed successfully.
using System;
using System.Collections;
class Sample
{
//Entry point of Program
static public void Main()
{
string OsVer = "";
OsVer = Environment.OSVersion.ToString();
Console.WriteLine("OS Version:\n"+OsVer);
}
}
Output:
OS Version:
Microsoft Windows NT 6.1.7600.0
Press any key to continue . . .
Program:
The source code to get the Operating System version of computer using Environment class is given below. The given program is compiled and executed successfully.
Output: