Thursday 17 November 2011

How to get Temporary Folder using .NET (C#)

How to get path of the current system's temporary folder using .NET (C#)

Temporary folders are useful to store simple logs during execution of the program. It is also used for storing the decompressed files before any operation. The folder location varies from OS to OS. The following C# snippet would help in retrieving the Temporary folder path
string sPath;
sPath = Path.GetTempPath();
Console.WriteLine("Temporary Path := " + sPath );

No comments:

Post a Comment