Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET get a local temp directory accessible by all users

Tags:

.net

directory

As the title states, how can i get a temp directory acessible by all users.

Path.GetTempPath() returns the temp directory for the current user.

like image 268
Simon Avatar asked Jan 24 '12 05:01

Simon


Video Answer


1 Answers

Environment.ExpandEnvironmentVariables(@"%SystemRoot%\Temp");

Be aware though, that temp directories are a significant possible security risk, as they can be used to attack other users via corrupting shared data.

like image 86
Ana Betts Avatar answered Oct 19 '22 08:10

Ana Betts