Difference between 'SpecialFolder.LocalApplicationData' and 'SpecialFolder.ApplicationData'?

半腔热情 提交于 2019-11-28 04:52:50

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.

According to MSDN the difference is that LocalApplicationData stays on the local machine and does not roam... ApplicationData does roam for example if the user logs onto the domain from a different computer it will be synced...

The LocalLow refers to specific situations likea BHO running in "Protected Mode" of IE...

For a standard application always use ApplicationData. Use LocalApplicationData for things that should NOT roam with the user...

From MSDN - Environment.SpecialFolder Enumeration:

ApplicationData - The directory that serves as a common repository for application-specific data for the current roaming user. A roaming user works on more than one computer on a network. A roaming user's profile is kept on a server on the network and is loaded onto a system when the user logs on.

LocalApplicationData The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user.

In short, use ApplicationData for roaming profiles, and LocalApplicationData for non roaming profiles.

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