简体   繁体   中英

Accessing Registry.LocalMachine on 64bit OS

I have some code below that is accessing the registry. The application is built for x86 but when run on a 64bit OS it does not find the registry key. I thought that if it was compiled for x86 it would be ok and not try to look in the Wow6432Node node.

Am I doing something wrong or is it just that on a 64bit OS the registry keys should be under the Wow6432Node node?

RegistryKey OurKey = Registry.LocalMachine;
OurKey = OurKey.OpenSubKey(@"SOFTWARE\Inspectron\ImageChecker");

is it just that on a 64bit OS the registry keys should be under the Wow6432Node node?

Yes.. That's right.. 64bit OS (Windows) stores 32 bit application's keys only inside the Wow6432Node.

Hence you have to look for your key inside the Wow6432node's registry hive.

在“运行”中输入“ regedit”字符串,您将获得注册表列表

Ram确认注册表中的密钥必须在Wow6432node中,然后我发现编译为x86并使用已经存在的代码意味着它将在Wow6432node下查找密钥。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM