在删除注册表中的HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\RecentDocs\\.a项时总是报错是为什么呀??
2 回答

紫衣仙女
TA贡献1839条经验 获得超15个赞
RegistryKey LM = Registry.LocalMachine;
RegistryKey software = LM.OpenSubKey("SOFTWARE", true);
RegistryKey Ustop = software.OpenSubKey("Ustop", true);
Ustop.DeleteSubKeyTree("???");

LEATH
TA贡献1936条经验 获得超6个赞
OpenSubKey 方法有两个参数,第二个应该是true, 可能是这个原因吧。另外你是在什么环境下些?如果是IIS,要把Application pool 设定为Local system,xp下,要把ASPNet 账户设定为administrators.
- 2 回答
- 0 关注
- 403 浏览
添加回答
举报
0/150
提交
取消