如何在Win7中使用C#在没有UAC的情况下读写文件 [英] How to read and write file without UAC in win7 with C#
本文介绍了如何在Win7中使用C#在没有UAC的情况下读写文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我开发了一个程序,但是当我在Windows 7上运行应用程序时,由于读取了卷C"中的文件,因此我的用户访问被拒绝.以管理员身份运行时,可以.
请[告诉我]如何解决此问题.我们将不胜感激.
Hi everyone
I developed a program but when I run my application on windows 7, I get user access denied since I read a file in "Volume C", When I run as an administrator, it is ok.
Please [tell me] how to solve this. Any help will be appreciated.
推荐答案
使用UAC,仅仅因为您以具有管理员权限的用户身份登录并不意味着程序实际上与它们一起运行.该程序必须请求特权提升(这会给您是否要允许此程序_ _" UAC弹出窗口)或显式以管理员身份运行(在程序/快捷方式上单击鼠标右键,然后选择以管理员身份运行") .
默认情况下,驱动器的大多数区域在标准用户文件"之外. (又称我的文档"和我的文档"公司)仅限于管理员访问,但可以根据需要更改文件夹权限以添加特定用户的访问权限.
With UAC, just because you are logged in as a user with administrator privileges does not mean a program actually runs with them. The program has to either request privilege elevation (which gives the "Do you want to allow this program to _" UAC pop-up) or explicitly be run as administrator (right-click on the program/shortcut and choose Run as Administrator).
By default most areas of the drive outside of the standard "user files" (a.k.a. My Documents & co.) are restricted to administrator-only access, but the folder permissions can be changed to add access for a particular user if desired.
这篇关于如何在Win7中使用C#在没有UAC的情况下读写文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文