问题
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