Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

On my system, %AppData% leads to ApplicationData which is C:Users<USER>AppDataRoaming

But there is also C:Users<USER>AppDataLocal
And for some more confusion D:Users<USER>AppDataLocalLow

string local = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string roaming = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

My question is, to which of these locations should my application save its data?

Are there guidelines for which of these locations to use? And am I leaving myself open to problems if I choose the wrong location?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
465 views
Welcome To Ask or Share your Answers For Others

1 Answer

The Roaming folder is copied between machines when roaming profiles are enabled (in a domain environment). Use it for application data that you want to share between machines. But don't store large files in there -- IT departments don't like it when you do that, and it increases the time taken for the user to log in and to log out as the files are copied around.

The Local folder is not copied between machines. Use it for application data that's specific to a machine.

The LocalLow folder is used for low-privilege tasks (such as Internet Explorer). You shouldn't need to worry about it.

For files that the user specifically saved, you should put them (by default) in the Documents folder.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...