Retrieves all environment variable names and their values from the current process.
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); } } }