Rotate your phone or change to desktop for better experience

Rotate your phone or change to desktop for better experience

1. Write a C# program to show the machine details like machine name, Operating System, Version, Physical Memory and calculate the time since the Last Boot Up. (Hint:Use System.Environment Class).

using System;

class MachineDetails

{

static public void Main()

{

// Here we get the machine name

// Using the MachineName property

// of the Environment class

Console.WriteLine();

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" Machine Name is " + Environment.MachineName);

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" Operating System Detaiils");

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" OS Version: " + Environment.OSVersion);

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" Amount of physical memory : " + Environment.WorkingSet);

Console.WriteLine();

Console.WriteLine();

Console.WriteLine(" Number of milliseconds elapsed since system

started:"+Environment.TickCount);

Console.ReadKey();

}}

Post a Comment

0 Comments