Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试删除我的程序之前创建的子项,但出现以下错误:
无法删除子项树,因为子项不存在。
这是代码:
RegistryKey reg; reg = Registry.CurrentUser.OpenSubKey("SOFTWARE\\MyCompany\\MyProgram",true); if (reg != null) { reg.DeleteSubKey("mysubkey"); reg.Close(); }
我已经在注册表中验证了子项存在。