You can use both as MS says : Reading from and Writing to the Registry Using the Microsoft.Win32 Namespace (Visual Basic)
Microsoft.Win32.Registry is generally used for both C# & VB
For booleans, you can see the answer in this thread : Boolean values and the registry
(C# but same logic...)
Simple Registry Question
OSVBNET
1,391
Reputation points
Hello
The different between these 2 and which one recommended to use?
Dim MyKey As Microsoft.Win32.RegistryKey = My.Computer.Registry.LocalMachine.OpenSubKey("xxx")
Dim MyKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("xxx", False)
and is this the safest and best method to convert to boolean when reading a DWORD?
blah = Convert.ToBoolean(MyKey.GetValue("Enabled"))
Thanks :)
Developer technologies VB
2,892 questions
Accepted answer
-
Castorix31 90,521 Reputation points
2022-03-18T14:47:24.25+00:00