I'm just familiarising myself to edit registry in VB. I am having a problem with changing a value in the HKEY_LOCAL_MACHINE
key. When ever I change a value at runtime it always assumes that I am going in the "Wow6432Node" key, e开发者_运维百科ven though I don't put that in the parenthesis. Example: My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL", "CheckedValue", 1)
"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL"
in the string.
The program is running as administrator.
That's called registry redirection. In 64 bit Windows some registry keys (including HKLM\Software) are redirected for 32 bit applications. If you changed the build properties on your VB.NET project to x64 you would see it write to HKLM\Software. You can access the non-redirected keys using flags, but I believe those are only available for the unmanaged APIs.
But the short answer is you not doing anything wrong, and that how it is supposed to work.
精彩评论