Possible Duplicate:
C# WOW6432 registry node messin things up
This is the code:
var b1 = Registry.LocalMachine.OpenSubKey("software", true);
var b2 = Registry.LocalMachine.OpenSubKey("software", true).OpenSubKey("company");
var r1 = Registry.LocalMachine.OpenSubKey("software").OpenSubKey("company").GetValueNames();
string resultString = Registry.LocalMachine.OpenSubKey("Software", true).CreateSubKey("company").GetValue(name).ToString();
I invoke it with name
= "ApplicationDirectory"
. At the last line, the first two variables point to the correct locations (based on their Name
property). The problem is with r1
, which doesn't list the contents of HKEY_LOCAL_MACHINE\SOFTWARE\company
, but rather HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\company
. Why is this? Is this some redirection in 64-bit machines?