Tutorial :Change temporary path


Exsits any way to modify the temporary folder path returned by System.IO.Path.GetTempPath() method?

My asp.net application run under iis 7.



Presumably, you don't want to change the returned path (value), but change the actual path?

As you can see here, the value returned depends on a number of possible environmental variables. You'd need to change these to change the returned path.


I wonder why you want to change that, as no matter what path it is returned, your application uses it as a temp folder (where the files can be cleaned freely).

If your application does care the existence of the files, write them to your own temp folder, which means you should give up System.IO.Path.GetTempPath(). Many applications, even Microsoft's, use their own temp folders.

I don't think you should change any temp folder environment variables as that will affect other applications unnecessarily (though they should not care if they really treat the folder as a temp folder :)).

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »