在 Vista/Win7 上,所有具有读/写权限的用户在哪里存储文件
可能的重复:
在哪里放置常见的可写应用程序文件?
在我的应用程序中,我有一些设置文件,需要读/写权限,并且应该可供所有用户访问。
目前我在网上发现,微软在Win Vista/7中提供了一些特殊的文件夹,但没有一个能满足我的需求:
1) CSIDL_COMMON_APPDATA =>; C:\ProgramData,无写权限
2)CSIDL_APPDATA =>是用户特定的
3)CSIDL_LOCAL_APPDATA =>是特定于用户的
我如何访问这样的文件夹,其中包含应用程序数据,所有用户都可以访问并且具有读/写权限?
Possible Duplicate:
Where to put common writable application files?
In my application I have some setting-files, which needs read/write permission and should be accessable by all users.
So far I found in the net is, that microsoft gives you some special folders in Win Vista/7, but none of them fulfills my needs:
1) CSIDL_COMMON_APPDATA => C:\ProgramData, has no write permission
2) CSIDL_APPDATA => is user specifc
3) CSIDL_LOCAL_APPDATA => is user specific
How can I access such folder, which contains APP DATA, is accessable by all users and has read/write permission?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在系统范围的安装中,您必须将它们写入 CSIDL_COMMON_APPDATA。
但您还必须在设置中设置权限。
不要给“每个人”权限 -
如果您使用 Windows 安装程序,“经过身份验证”会更好,那么您必须照顾用户和系统安装。如果是用户安装,则必须写入 CSIDL_APPDATA 或 CSIDL_LOCAL_APPDATA(取决于漫游或非漫游数据)。
如果您懂德语,请查看 entwickler 杂志 3.2011。
将会有一篇文章“Einstellungssache”,这是主题。
MSDN - 数据和设置管理
on a system wide installation, you have to write them to CSIDL_COMMON_APPDATA.
but you have also to set the permissions within your setup.
don't give rights to "everybody" - "authenticated" is better
if you are using windows installer, then you have to take care of users and system installations. if it is a user installation, you have to write to the CSIDL_APPDATA or CSIDL_LOCAL_APPDATA (depending of roaming or not roaming data).
If you understand german take a look in the entwickler magazin 3.2011.
there will be a article "Einstellungssache", which is on topic.
MSDN - Data and Settings Management