Microsoft是否有关于在不同Windows平台上存储应用程序数据与用户数据的最佳实践文档? [英] Does Microsoft have a best practices document regarding the storage of App Data vs User Data on different Windows Platforms?

查看:182
本文介绍了Microsoft是否有关于在不同Windows平台上存储应用程序数据与用户数据的最佳实践文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建针对许多Windows版本的应用程序时,最佳做法是确定应将应用程序特定数据存储在何处。具体来说:

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:


  • 特定于应用程序的数据(例如应用程序配置数据)

  • 特定于用户的数据/设置

例如,我知道在Windows Vista上可以使用环境变量,例如%APPDATA%,但是Windows 7呢? Windows XP,Windows 98。

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.

我的主要问题是,Microsoft是否为此拥有最佳实践文档,概述了不同类型数据(应用程序与。用户)以及在读写这些位置时需要牢记的安全隐患?

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?

我也对这不仅与之相关也很感兴趣。 NET应用程序(可以使用ApplicationSettingsBase的应用程序),也可以在非托管的C / C ++应用程序中使用。

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.

感谢Pax和Remus给出了两个不错的答案。
我也找到了此项目(特定于XP):

Thanks to Pax and Remus for both of the great answers. I've found this item as well (specific to XP):

如何编写在正确位置存储用户和应用程序数据的Windows XP应用程序通过使用Visual C ++

推荐答案

此处各种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.

请注意,从Vista开始,该方法已进行了一些更改。现在,它使用 KNOWNFOLDERID 代替 CSIDL ,并且功能也已更改。请参见此处

Note that, as of Vista, the method has changed a little. It now uses KNOWNFOLDERID instead of CSIDL 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.

这篇关于Microsoft是否有关于在不同Windows平台上存储应用程序数据与用户数据的最佳实践文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆