get environment variables
Published: 5. January 2009 | Updated: 5. January 2009License: Microsoft Public License (MS-PL)
Categories: Framework, Windows
Tags: C# Windows
Import namespace
using System.Collections;
Iterate environment variables
foreach (DictionaryEntry entry in Environment.GetEnvironmentVariables()) { Console.WriteLine("{0} = {1}", entry.Key, entry.Value); }
Get specific variable
string value = Environment.GetEnvironmentVariable("TEMP");
| Send us feedback about this snippet » |





