LocalUserAppDataPath 和 UserAppDataPath 有什么区别?
在System.Windows.Forms.Application
中,有两个名为LocalUserAppDataPath
和UserAppDataPath
的属性。在此计算机(运行 Vista)上,这些对应于
C:\Users\UserName\AppData\Local\CompanyName\ProductName\ProductVersion
和C:\Users\UserName\AppData\Roaming\CompanyName\ ProductName\ProductVersion
这两者有什么区别?什么时候使用第一个,什么时候使用第二个?
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
andC:\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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用域/Active Directory 设置,则当用户注销时,漫游配置文件(可以)会复制到中央服务器,并在用户登录时从服务器复制。
本地配置文件始终“本地”存储在电脑。
通常最好使用漫游配置文件夹,因为这将允许用户使用不同的电脑并仍然访问他们的数据。但如果数据很大,请将其存储在本地以防止登录缓慢。
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.
非本地用户是(在许多网络用户配置中)将被传输到任何计算机的设置,无论用户在何处登录。另一方面,本地用户特定于用户当前登录的计算机如果用户在其他地方登录(即 Windows 不会通过网络同步此数据),则不会将其传输到域中的其他计算机。
使用哪个取决于您认为用户对任何给定项目的功能需求。
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.