0
点赞
收藏
分享

微信扫一扫

System.UnauthorizedAccessException: 无法写入到注册表项

新鲜小饼干 2023-04-27 阅读 104


C#操作注册表,在写入注册表值的时候报错

System.UnauthorizedAccessException: 无法写入到注册表项

给OpenSubKey()方法给第2个参数设置为true就可以了,第2个参数为true代表可读可写注册表

RegistryKey hkml = Registry.CurrentUser;
RegistryKey aimdir = hkml.OpenSubKey("Asp Net Settings",true);




黑色头发:http://heisetoufa.iteye.com


举报

相关推荐

0 条评论