using System; using System.Collections; class Sample { public static void Main() { IDictionary environmentVariables = Environment.GetEnvironmentVariables(); foreach (DictionaryEntry de in environmentVariables) { Console.WriteLine(" {0} = {1}", de.Key, de.Value); } } }