這是代碼:
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();
我name
= "ApplicationDirectory"
調用它。在最後一行,前兩個變量指向正確的位置(基於它們的Name
屬性)。問題是r1
,它沒有列出HKEY_LOCAL_MACHINE\SOFTWARE\company
的內容,而是HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\company
。爲什麼是這樣?這是64位機器中的一些重定向嗎?
簡答:[是](http://msdn.microsoft.com/en-us/library/aa384232(v = vs.85).aspx)。 – Blorgbeard
64位計算機有一個註冊表分隔爲32位。我認爲它被稱爲註冊表虛擬化。 –
http://stackoverflow.com/questions/8959983/c-sharp-wow6432-registry-node-messin-things-up/8960020#8960020 –