Beyond perplexed this time...
The simplest possible line of code works sometimes, sometimes it doesn't. First I thought the issue was that I was trying to read the value of a DWORD, but since I CAN read DWORD values from SOME keys, that must not be the problem. Now the problem seems to be that I can't read from ANY key if the key has a space in the name. Surely this can't be. I refuse to believe that MS didn't account for spaces in registry key paths and names.
So tell me why this doesn't work:
MsgBox(My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\CA\CA ARCserve D2D\WebService", "Port", Nothing))
It just pops up an empty box. And yes, a value does exist in the registry, and yes, I have permission to read the key.
EDIT: Yup, over and over again it seems that you can't read from the registry if there are spaces anywhere in the key name. Seriously?!?
EDIT AGAIN: "Ramhound" says code examples are stupid. Fascinating point of view. However his own suggestion also failed:
Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\ATI Technologies\CBT")
Dim objValue As Object
objValue = key.GetValue("ReleaseVersion")
MsgBox(objValue.ToString())
After an entire wasted day, the solution is to set your VS project to "any cpu" in advanced compile options because if set to x86 and running on a 64bit OS you are limited to the "Wow6432node" in the registry.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With