use Environment object to get Environment variable - CSharp System

CSharp examples for System:Environment

Description

use Environment object to get Environment variable

Demo Code

using System;//from www. j  ava  2  s.c  o  m
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
class Program
{
   static void Main(string[] args)
   {
      // Displaying components of Environment object
      Console.WriteLine("Device name: " + Environment.MachineName);
      Console.WriteLine("64-bit system: " + Environment.Is64BitOperatingSystem);
      Console.WriteLine("User name: " + Environment.UserName);
   }
}

Result


Related Tutorials