哪个是在WINDOWS中保存程序配置文件的最佳位置? [英] Which is the best location to keep program configuration file in WINDOWS?

查看:551
本文介绍了哪个是在WINDOWS中保存程序配置文件的最佳位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序需要将一些配置详细信息保存在.ini文件中。这个程序还安装了IE和Firefox的扩展,我也希望从这些扩展中读取这些.ini文件。如果我将.ini保留在... AppData / Roaming ...中,则保护模式下的IE扩展将无法读/写。据我所知,只有AppData / LocalLow才能在保护模式下读取。如果我将所有配置细节移动到这个... AppData / LocalLoe ...它会一直运行吗?这是标准的方式吗?我编写的所有内容都在Vista上下文中,它可以与XP一起使用吗? Win7?

My program requires some configuration details to be kept in a .ini file. This program also installs extensions to IE and firefox and i want to read these .ini file from these extensions also. If I kept .ini in "...AppData/Roaming..." the IE extension in protected mode won't be able to read/write. As far as I know only AppData/LocalLow can only be able to read in protected mode. If I am moving all my configuration details to this "...AppData/LocalLoe..." will it work all times? Is this the std way? everything i written is in Vista context, will it work with XP? Win7?

推荐答案

请参阅我对这个问题的回答:如何确定每个用户状态的存储位置?注册?应用程序数据?隔离存储?

See my answer to this question: How to decide where to store per-user state? Registry? AppData? Isolated Storage?

从那里引用:

用户漫游文件夹中的文件在Vista或XP中的应用程序数据随用户移动 - 所以任何设置和数据都应存储在那里。

Files in the User's "Roaming" folder in Vista or "Application Data" in XP move around with the user - so any settings and data should be stored there.

Local和LocalLow下的文件XP中的vista和Local Settings没有,所以它是临时文件,与特定计算机相关的东西或可以重新计算的数据的好地方。

Files under "Local" and "LocalLow" in vista and "Local Settings" in XP do not, so it's a good place for temp files, things that are tied to the specific computer or data that can be recalculated.

在Vista中,作为我们都知道和喜爱的新安全功能的一部分,您可以让程序以低完整性模式运行(例如IE在受保护模式下),这些程序以降低的权限运行,无法访问用户的个人资料 - 除了LocalLow文件夹下的文件。

In Vista, as part of the new security features we all know and love, you can have programs running in "low integrity mode" (for example IE in protected mode), those programs are running with reduced privileges and can't access files in the user's profile - except for files under the "LocalLow" folder.

因此,总之,存储在LocalLow中的文件本质上是不安全的,文件在Local/某些大型公司可能无法使用本地设置 - 因此,除非您有充分的理由并且确切知道你正在做什么用漫游/应用数据。

So, in conclusion, files stored in "LocalLow" are inherently insecure and files in "Local"/"Local Settings" are likely to be unavailable in some large companies - so unless you have good reason and know exactly what you are doing go with "Roaming"/"Application Data".

更新:


  1. 当使用个人资料漫游(大型合作环境)时,Local和LocalLow的内容可以(并且将会)消失,恕不另行通知。

  2. 这些是所有每用户设置,如果您的服务器在不同于用户(例如,系统或网络)的帐户下运行,他们将获得这些文件夹的不同副本。

这篇关于哪个是在WINDOWS中保存程序配置文件的最佳位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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