Search This Blog

Tuesday, January 19, 2010

Get windows temporary path c#

C# > Files > GetTempPath

GetTempPath retrieves the path of the directory designated for temporary files.

Order to check for the existence of environment variables:
  1. TMP environment variable.
  2. TEMP environment variable.
  3. USERPROFILE environment variable.
  4. Windows directory.
Example:

String tempPath = System.IO.Path.GetTempPath();