问题描述
我正在尝试调用.Net RegistryKey.DeleteSubKey,以删除远程计算机上的注册表项.这是在.Net 4.0上,而远程计算机是XP.
I am trying to call .Net RegistryKey.DeleteSubKey to delete a registry key on a remote machine. This is on .Net 4.0 and remote machine is a XP.
RegistryKey RegistryKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,"WinXPMachine");
RegistryKey registryKey =
RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, "WinXPMachine");
…..
RegistryKey.DeleteSubKeyTree(regKey,true);
…..
registryKey.DeleteSubKeyTree(regKey, true);
呼叫失败,并显示此错误.
The call failed with this error.
过程号超出范围.
在Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode,String str)
在Microsoft.Win32.RegistryKey.DeleteSubKey(字符串子项,布尔型throwOnMissingSubKey)
The procedure number is out of range.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.DeleteSubKey(String subkey, Boolean throwOnMissingSubKey)
推荐答案
欢迎来到MSDN论坛.
Welcome to the MSDN Forum.
这是一条简短的说明,旨在让您知道我正在就此问题进行研究,并将尽快与您联系.感谢您的耐心等候.
This is a quick note to let you know that I am performing research on this issue and will get back to you as soon as possible. I appreciate your patience.
最好的问候
这篇关于RegistryKey.DeleteSubKey失败,过程号超出范围.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!