在 Vista/Win7 上,所有具有读/写权限的用户在哪里存储文件

发布于 2024-11-14 15:07:45 字数 477 浏览 4 评论 0原文

可能的重复:
在哪里放置常见的可写应用程序文件?

在我的应用程序中,我有一些设置文件,需要读/写权限,并且应该可供所有用户访问。

目前我在网上发现,微软在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑红尘 2024-11-21 15:07:45

在系统范围的安装中,您必须将它们写入 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文