访问被拒绝的问题 [英] Access denied problem

查看:66
本文介绍了访问被拒绝的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vs2010中为连接数据库mdf文件的.net c#中的win应用程序创建了一个设置。当我安装这个任何PC时,mdf文件变为只读,并且在win 7中它的给定访问被拒绝错误。它将在手动给定权限之后工作,但是它不正确。



所以任何人都建议我如何解决这个问题...

I create a setup in vs2010 for win application in .net c# with database mdf file attached. when i install this any pc then mdf file becomes read only and its given access denied error in win 7. it will work after given rights manually but its not right way.

so any one suggest me how it will resolve this problem...

推荐答案

可能这与你放置文件的位置有关 - 如果它在你的应用程序文件夹然后它将不可用,因为系统不喜欢人们在没有管理员权限的情况下更改应用程序文件的内容。



看看将它移动到更友好 location:我应该在哪里存储数据? [ ^ ]应该有帮助。
Probably, this is related to where you have put the file - if it is in your application folder then it will be unavailable since the system does not like people changing the content of application files without admin rights.

Look at moving it to a more "friendly" location: Where should I store my data?[^] should help.


在您的设置中,您可以包含一个自定义操作,用于设置文件的访问权限。当您将文件放入ProgramData文件夹的子文件夹时,有时可能需要这样做。
In your setup, you could include a custom action which sets the access rights to the file. That may sometimes happen to be necessary when you put the file into a subfolder of the ProgramData folder too.


这篇关于访问被拒绝的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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