tags:

views:

13

answers:

2

Hi all,

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

My asp.net application run under iis 7.

Thanks

A: 

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.

Tobiasopdenbrouw
I need to change the actual path only for my asp.net web application
alfdev
A: 

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 :)).

Lex Li