问题描述
我有:
-
Environment.SpecialFolder.ApplicationData
-
Environment.SpecialFolder.CommonApplicationData
-
Environment.SpecialFolder.LocalApplicationData
Environment.SpecialFolder.ApplicationData
Environment.SpecialFolder.CommonApplicationData
Environment.SpecialFolder.LocalApplicationData
我不清楚这些指向Windows XP和/或Windows Vista.
I am unclear as to were these point to in Windows XP and/or Windows Vista.
到目前为止,我发现,ApplicationData指向XP中当前用户的ApplicationData文件夹,而Vista中则指向漫游的应用程序数据文件夹.
What I found so far is that the ApplicationData points to the ApplicationData Folder for the current user in XP and the roaming application data folder in Vista.
我还想知道是否有关于何时使用哪种通用指南.
I would also like to know if there are general guidelines on when to use which.
推荐答案
对此没有唯一的答案.实际上,这正是为什么被定义的"SpecialFolder".您可以使用这些路径而不是硬编码的路径.
There's no single answer to that. In fact, that's precisely why these "SpecialFolder"s are defined. You use those instead of a hardcoded path.
Environment.SpecialFolder.ApplicationData
是最常见的一个.该文件夹保存每个用户的非临时的特定于应用程序的数据,而不是用户文档.一个常见的例子是设置或配置文件.
Environment.SpecialFolder.ApplicationData
is the most common one. This folder holds per-user, non-temporary application-specific data, other than user documents. A common example would be a settings or configuration file.
Environment.SpecialFolder.CommonApplicationData
是相似的,但在用户之间共享.例如,您可以使用它来存储文档模板.
Environment.SpecialFolder.CommonApplicationData
is similar, but shared across users. You could use this to store document templates, for instance.
Environment.SpecialFolder.LocalApplicationData
是ApplicationData的非漫游替代方案.因此,您永远不会在其中存储重要数据.但是,由于它是非漫游的,因此是临时文件,缓存等的理想位置.它通常在本地磁盘上.
Environment.SpecialFolder.LocalApplicationData
is a non-roaming alternative for ApplicationData. As such, you'd never store important data there. However, because it's non-roaming it is a good location for temporary files, caches, etcetera. It's typically on a local disk.
这篇关于Windows XP和Windows Vista中,不同的Application SpecialFolders指向哪些目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!