What is the difference between LocalUserAppDataPath and UserAppDataPath?

点点圈 提交于 2019-12-10 18:10:23

问题


In System.Windows.Forms.Application there are two properties called LocalUserAppDataPath and UserAppDataPath. On this computer (running Vista) these corresponds to

  • C:\Users\UserName\AppData\Local\CompanyName\ProductName\ProductVersion and
  • C:\Users\UserName\AppData\Roaming\CompanyName\ProductName\ProductVersion

What is the difference between these two? When would you use the first and when would you use the second?


回答1:


If you are on a Domain / Active Directory setup, the Roaming profile (can be) is copied to a central server when the user logs out, and from the server when the user logs in.

The local profile is always stored 'locally' on the PC.

Its generally better to use the Roaming profile folder as that will allow users to use different PCs and still access their data. If the data is very large however, store it locally to prevent slow logins.




回答2:


The non-local user are settings that (in many network user configurations) will be transferred to any machine no matter where the user logs in. The local user, on the other hand, is specific to the machine on which the user is currently logged in and will not be transferred to other machines on a domain if the user logs in elsewhere (i.e. no synchronization of this data across the network by Windows).

Which to use depends on what you think a user will want functionality-wise for any given item.



来源:https://stackoverflow.com/questions/1660206/what-is-the-difference-between-localuserappdatapath-and-userappdatapath

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