请求的注册表访问被拒绝 [英] Requested registry access is denied
本文介绍了请求的注册表访问被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
该应用程序是用vb.net编写的.调试代码时,导致问题的部分如下:
Hello,
The application is written in vb.net. When debugging the code, the section which causes an issue is as follows:
Dim RegKey As RegistryKey
RegKey = Registry.LocalMachine.OpenSubKey(Path, True)
执行上述语句后,发生异常请求的注册表访问被拒绝".操作系统为Windows#7.
必须提到的是,上面的代码在Windows XP上可以完美地运行.
我们将不胜感激.
When the above statement is executed the exception ''Requested registry access is denied'' occurred. Operating system is of Windows #7.
It must be mentioned that the above code works perfectly on Windows XP.
Any help would be appreciated.
推荐答案
自Vista操作系统以来,应用程序需要提升的特权才能访问本地计算机"子树.请参阅堆栈溢出处的其他信息 [ ^ ].
Since Vista OS an application needs elevated privileges to access ''Local Machine'' subtree. See additional info at Stack Overflow[^].
This package was written a few years ago in order to implant a few details in registry. I appreciate that Microsoft promote individual to use ‘Settings’ or create some kind of XML file to save any details which your package need. As a result my approach is as such now days.
However, in order to resolve this issue and for the purpose of debugging, I have disabled UAC (User Account Control). By implementing this, the issue is resolved.
这篇关于请求的注册表访问被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文