不允许请求的注册表 [英] Requested registry not allowed

查看:95
本文介绍了不允许请求的注册表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我通过不在管理员组中的用户帐户登录窗口.
当我运行我的应用程序以访问注册表时,错误已显示.

我的代码在这里.

将Reg作为注册表项
reg = registry.LocalMachine.OpenSubkey(path,true)


这样可以帮助我. Thanks

Hi all

I log in my window by user account not in administrator group.
When i run my application to access registry the error has been shown.

my code here.

dim Reg as registrykey
reg=registry.LocalMachine.OpenSubkey(path,true)


so can help me. thanks

推荐答案

OpenSubKey的第二个参数指定您希望对注册表项具有可写访问权限.
除非在注册表上更改了默认权限(不推荐),否则该程序所运行的帐户必须位于admin组中,才能对LocalMachine下的密钥进行可写访问.

如果您不打算修改注册表项,而只是阅读它,则将代码更改为:

The second parameter to the OpenSubKey specifies that you wish writeable access to the registry key.

The account the program is running under needs to be in the admin group for writeable access to a key under LocalMachine unless the default permissions have been changed on the registry (not recommended).

If you are not planning on modifying the registry key but just read it then change your code to:

<br />
reg = Registry.LocalMachine.OpenSubkey(path)


这篇关于不允许请求的注册表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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