常见的可写应用程序文件放在哪里?
我认为 CSIDL_COMMON_APPDATA\company\product 应该是放置应用程序所有用户通用的文件的位置,并且应用程序可以修改这些文件,但是,在 Vista 上,这是一个只读位置,除非由安装程序修改(根据 MSDN - http://msdn.microsoft. com/en-us/library/ms995853.aspx),那么...什么是最好的? 修改位置的安全设置以允许写入或改用 CSIDL_COMMON_DOCUMENTS\company\product
? 也许还有第三种选择?
另外,微软是否有对此的“官方”建议?
I thought that CSIDL_COMMON_APPDATA\company\product
should be the place to put files that are common for all users of the application and that the application can modify, however, on Vista this is a read-only location, unless modified by the installer (as per MSDN - http://msdn.microsoft.com/en-us/library/ms995853.aspx), so... what's best? Modify the location's security settings to allow writing or use CSIDL_COMMON_DOCUMENTS\company\product
instead? Maybe there's a third option?
Also, is there an "official" Microsoft recommendation on this somewhere?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
下面是一个简单的示例,展示了如何在 Common App Data 文件夹 (CSIDL_COMMON_APPDATA) 中为所有用户创建具有读/写权限的文件和文件夹。 任何用户都可以运行此代码来授予所有其他用户写入文件和文件的权限。 文件夹:
Here's a simple example showing how to create files and folders with Read/Write permission for all users in the Common App Data folder (CSIDL_COMMON_APPDATA). Any user can run this code to give all other users permission to write to the files & folders:
仅修改 AppData 目录的特定子目录的安全性(这来自 您提供的链接):
Modify just the security on a specific sub-directory of the AppData directory (this is from the link you provided):
Vista/UAC 指南可在此处找到。 在该页面搜索“
CSIDL
”,您会找到一些“官方”答案。Guidelines for Vista/UAC can be found here. Search that page for "
CSIDL
" and you'll find some "official" answers.我认为这篇文章可能会回答一些问题,但是对于许多人来说这似乎是一个难题。
显然,CSIDL_COMMON_DOCUMENTS 提供了一种通用的解决方法
I think this post may answer some questions, but it seems a difficult problem for many.
Apparently, CSIDL_COMMON_DOCUMENTS provides a common workaround