Where should I generate temporary files for my application?

0 votes
asked Jun 25, 2009 by pwninstein

I've been warned by several people not to store temporary files in the Temporary Internet Files directory. Where would be the best place to store any temporary or log files that my application generates?

3 Answers

0 votes
answered Jun 25, 2009 by jp-alioto

You best bet is to use isolated storage for temp files, but you can also use GetTempFileName.

0 votes
answered Jun 25, 2009 by jaredpar

Is there a reason you can't use the default temporary directory? Essentially use the name returned from Path.GetTempFileName?

0 votes
answered Jun 25, 2009 by raj-more

Temporary Internet Files folder is different from the TEMP folder. I agree about not using the Temporary Internet Files folder - it is meant for a different usage.

The TEMP folder should be used for files that can be blown away without fear of crash.

The TEMP folder, however, is no place for log files or configuration files or anything of importance. I would create my own folder under the user's profile preferably in the Application Data or Local Settings.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...