开发者

Registry System.UnauthorizedAccessException

when I'm trying to开发者_运维知识库 create a subkey in Registry.ClassesRoot I get an System.UnauthorizedAccessException! I'm using win7. Does anyone know why?


Because only people in the Administrator group can create keys under HKEY_CLASSES_ROOT.

In general, you shouldn't need to be creating keys under there (if it's part of an install process, then you should probably be using a proper installer with transaction and rollback support - such as Windows Installer - not rolling your own).

But to solve your specific problem, then you need to run your application as Administrator.


Check that your program run as administrator. By default win7 does not run programs with admin permissions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜