从64位注册表视图无法访问Wow6432Node子项

时间:2015-08-20 17:52:17

标签: c# .net registry regedit

我正在编写一个遍历注册表的程序。遇到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.exereg.exe找到此密钥,结果是确实可以使用此方法查看子密钥。此外,

key.GetSubKeyNames()

返回名称的完全相同的值。

我尝试编译64位和32位CPU并将RegistryView.Registry32RegistryView.Registry64传递给第一个

RegistryKey.OpenBaseKey(hive, view)

呼叫。 这并没有解决问题。

为什么返回的密钥null

0 个答案:

没有答案
相关问题