LocalUserAppDataPath 和 UserAppDataPath 有什么区别?

发布于 2024-08-09 20:55:08 字数 392 浏览 4 评论 0原文

System.Windows.Forms.Application 中,有两个名为LocalUserAppDataPathUserAppDataPath 的属性。在此计算机(运行 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 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浪推晚风 2024-08-16 20:55:08

如果您使用域/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.

追风人 2024-08-16 20:55:08

非本地用户是(在许多网络用户配置中)将被传输到任何计算机的设置,无论用户在何处登录。另一方面,本地用户特定于用户当前登录的计算机如果用户在其他地方登录(即 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文