Microsoft 是否有关于不同 Windows 平台上应用程序数据与用户数据存储的最佳实践文档?
创建面向多个 Windows 版本的应用程序时,确定应用程序特定数据应存储在何处的最佳实践是什么。具体来说:
- 应用程序特定数据(例如应用程序配置数据)
- 用户特定数据/设置
我知道在 Windows Vista 上有一些环境变量,例如 %APPDATA%,可以使用,但是 Windows 7、Windows XP、Windows 98 呢?
我的主要问题是,微软是否有这方面的最佳实践文档,概述了不同类型数据(应用程序与用户)的文件系统位置以及在读取/写入这些位置时需要牢记的安全隐患?
我还感兴趣的是,这不仅适用于 .NET 应用程序(可以利用 ApplicationSettingsBase),而且适用于非托管 C/C++ 应用程序。
感谢 Pax 和 Remus 的精彩回答。 我也找到了这个项目(特定于XP):
When creating an application that will be targeted to many versions of Windows what is the best practice to determine where application specific data should be stored. Specifically:
- Application Specific Data (e.g. app config data)
- User Specific Data/Settings
I know on Windows Vista for instance there are environment variables, like %APPDATA%, that could be used, but what about Windows 7, Windows XP, Windows 98.
My main question is, does Microsoft have a best practices doc for this, outlining the file system locations for the different types of data (app vs. user) and the security implications that need to be kept in mind when reading/writing to these locations?
I'm also interested in how this pertains to not only .NET applications (where ApplicationSettingsBase can be utilized) but also in unmanaged C/C++ applications.
Thanks to Pax and Remus for both of the great answers.
I've found this item as well (specific to XP):
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此处对各种 CSIDL 有很好的描述值及其引用的文件夹(包括希望能够告诉您需要了解的内容的描述)。
它还包含指向用于检索这些特殊文件夹路径的函数的链接。
请注意,从 Vista 开始,该方法发生了一些变化。现在,它使用
KNOWNFOLDERID
而不是CSIDL
,并且功能也发生了变化。请参阅此处。您仍然可以使用旧函数(目前),因为我相信它们现在只是新函数的包装器。在未来的某个时刻,这种情况可能会改变。
There's a good description here of the various CSIDL values and the folders they refer to (including a description which should hopefully tell you what you need to know).
It also contains links to the functions you should use to retrieve these special folder paths.
Note that, as of Vista, the method has changed a little. It now uses
KNOWNFOLDERID
instead ofCSIDL
and the functions have changed as well. See here.You can still use the older functions (at the moment) since I believe they're now just wrappers around the new ones. At some point in the future, that may change.
这些通常在 Windows 软件徽标计划。该链接指向 Windows 7 徽标要求文档,但 XP、Windows 2003、Vista 和 Windows 2008 也存在类似的文档。在“技术要求”部分中,您将找到您要查找的一些信息:
编辑:
Windows 10 用户,查找 Windows 桌面应用程序的认证要求(第 10 节)
These are usually described in the Windows Software Logo Program. The link is to the Windows 7 logo requirements document, but similar documents exists for XP, Windows 2003, Vista and Windows 2008. In the Technical Requirements section you'll find some of the information you're looking for:
EDIT:
Windows 10 users, look for the Certification requirements for Windows Desktop Apps (Section 10)