Home   Cover Cover Cover Cover
 

Outputting Windows system variables

/csbook/solutions/18/A07.cs
using System;
using System.Collections;

class ListEnvironment {
  
  static void Main() {
    IDictionary var = Environment.GetEnvironmentVariables();
    foreach (string key in var.Keys)
      Console.WriteLine("{0} = {1}", key, var[key]);
  }
}