Retrieve all environment variables targeted at the process : Environment : Development C# Examples


C# Examples » Development » Environment »

 

Retrieve all environment variables targeted at the process









    
using  System;
using  System.Collections;

class  MainClass
{
        public  static  void  Main()
        {
                IDictionary  vars  =  Environment.GetEnvironmentVariables(
                        EnvironmentVariableTarget.Process);

                foreach  (string  s  in  vars.Keys)
                {
                        Console.WriteLine(s  +  "  =  "  +  vars[s]);
                }
                        
        }
}
    
   
  
   



Output

Path = C:\Program Files\Microsoft.NET\SDK\v2.0\Bin;
...

...


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» Environment