我正在编写一个遍历注册表的程序。遇到HKEY_CLASSES_ROOT\VirtualStore\MACHINE\SOFTWARE\Wow6432Node
- 键时,程序会停止,因为
var openedKey = key.OpenSubKey(/* any name of the present (!) subkeys*/);
// where "key" is "HKEY_CLASSES_ROOT\VirtualStore\MACHINE\SOFTWARE\Wow6432Node"
收益null
。
因此,我尝试使用regedit.exe
和reg.exe
找到此密钥,结果是确实可以使用此方法查看子密钥。此外,
key.GetSubKeyNames()
返回名称的完全相同的值。
我尝试编译64位和32位CPU并将RegistryView.Registry32
和RegistryView.Registry64
传递给第一个
RegistryKey.OpenBaseKey(hive, view)
呼叫。 这并没有解决问题。
为什么返回的密钥null
?