Get environment variable in CSharp

Description

The following code shows how to get environment variable.

Example


//from  ww  w .ja  va2 s . c o m
using System;
using System.Collections;
using Microsoft.Win32;

class Sample 
{
  public static void Main(){
        string str = Environment.GetEnvironmentVariable("A_GETSET_ENVAR_SAMPLE");
        Console.WriteLine(str);
  }    
}




















Home »
  C# Tutorial »
    Development »




Console
Encoding
Environment
Random