开发者

Change temporary path

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

My asp.net application run under iis 7.

Thanks


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜