且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我在访问注册表和创建文件夹时遇到问题.

更新时间:2023-09-26 07:50:33

听起来像Win7额外的安全层.即使您通过管理员帐户运行,如果系统安全性处于较高级别,它也会提示您提供权限,以避免通过编程/自动方式访问文件/文件夹.

由于您已经确定所使用帐户的管理员权限,因此只需松开Win7的安全性.我记得它有4个等级.允许安全性在没有提示的情况下传递并查看.那就应该可以了.现在,它绝对是特权问题,与代码无关.
Sounds like the Win7 extra security layer. Even if you run through the administrator account, if the system security is at high level, it prompts for permission to avoid access to files/folders programmatically/automatically.

As you are already sure of the admin priviledges to the account used, just loosen the security of Win7. It has 4 levels as much I remeber. Allow the security to pass on wihtout prompts and see. It should work then. For now, its definitly the priviledge issue and nothing related to code.


我在Windows 7上运行了同一段代码,但没有收到任何错误.它执行得很好,还创建了文件夹.我同意Sandeep的观点,因为我的用户帐户控制设置为UAC,所以从不通知
I ran the same piece of code on Windows 7 and did not get any error. It executed fine and also created the folder. I agree with Sandeep, since my User Account Control is set to UAC never notify