如何获得 Sql Compact 数据库的权限?
我有一个 Sql Compact Database v3.5,与我的应用程序捆绑在一起。安装应用程序时,数据库将被复制到应用程序的 Program Files 目录中。
由于Vista和Win7的安全设置,安装的应用程序无法访问数据库文件。这只是将数据库文件驻留在程序文件中的问题。
我想到的解决方案是将文件复制到Program Data中,但是有人有其他解决方案吗?我相信其他人也遇到过类似的问题。
预先感谢您的意见。
I have an Sql Compact Database v3.5 that I'm bundling with my application. When the application is installed, the database is copied into the application's Program Files directory.
Because of Vista and Win7's security settings, the installed application can't access the database file. It is merely a problem of having the database file reside in the Program Files.
The solution I have thought of is to copy the file into Program Data, but does anyone have another solution? I am sure others have come across a similar problem.
Thanks in advance for your input.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将应用程序数据存储在用户的应用程序数据目录中。或者在“默认用户”中。用户有权访问此目录,这就是预期目的。
http://blog.kowalczyk.info/article/获取用户特定的应用程序数据目录.html
store the application data in the user's application data directory. Or in 'default user'. The user has permission to this directory and that is the intended purpose.
http://blog.kowalczyk.info/article/Getting-user-specific-application-data-directory.html
使用
Environment.SpecialFolder
属性。将 DB 文件放置在所有用户的应用程序数据中或特定用户的应用程序数据中。像当今大多数应用程序一样,可能需要在安装时进行一些设置。
Use the
Environment.SpecialFolder
property. Place the DB file either in the app data all users or app data of the specific user.Probably will need some setting at install like most applications these days.