Where should my windows app store cache and tempfiles?

六眼飞鱼酱① 提交于 2020-01-06 03:22:15

问题


Where should a windows application store cache data and temporary file data ?

I understand that

System.Windows.Forms.Application.StartupPath + @"\" + "Cache";

is not a good idea since the program is going to probably be installed in

Program Files\MyProgram\

for all users and users may not have access to writing to that folder.


回答1:


Use this:

System.IO.Path.GetTempPath();

Closely related issue: How to get temporary folder for current user



来源:https://stackoverflow.com/questions/5420234/where-should-my-windows-app-store-cache-and-tempfiles

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!