HKLM\Software\Wow6432Node
默认情况下,在64位OS上的32位应用程序将查看该节点。要读取密钥的64位版本,您需要指定RegistryView
:
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
using (var key = hklm.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
{
// key Now points to the 64-bit key
}
.NET 4.0中已添加了用于执行此操作的API。如果您仍在使用3.5,则需要使用P / Invoke来访问64位密钥:http ://www.rhyous.com/2011/01/24/how-read- the-64-bit从32位应用程序注册或反之亦然/