const string subKeyPath = @”SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”;
RegistryKey uninstallNode = Registry.LocalMachine.OpenSubKey(subKeyPath);
结果读到”SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall”;
问一下怎么强制读取注册表的这个路径啊:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
RegistryKey uninstallNode = Registry.LocalMachine.OpenSubKey(subKeyPath);
结果读到”SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall”;
问一下怎么强制读取注册表的这个路径啊:SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
解决方案
40
using (var hklm = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64)) using (var key = hklm.OpenSubKey(subKeyPath)) { // ... }