Asked by:
How to get all the value in a registry key VB.net

Question
-
All replies
-
-
-
-
Good day ?!?
The name of this forum is: "Forums Issues (not product support)".
It explicitly tell you that this forum is NOT for production support!
This forum is for issues in the forums' system.Please close this thread by marking the best answer/response and ask again the right forum, which is the "dotnet-visual-basic" forum in the link bellow:
https://docs.microsoft.com/en-us/answers/topics/dotnet-visual-basic.html
Have a great day and stay safe
Ronen Ariely
[Personal Site] [Blog] [Facebook] [Linkedin] -
According to me, you cannot modify that key without admin rights for security reasons.
There is no way to get round that!- Proposed as answer by Roy Kaushik Wednesday, March 10, 2021 6:15 AM
- Unproposed as answer by Roy Kaushik Wednesday, March 10, 2021 6:15 AM
-
Try this:
You can use Registry.LocalMachine and its OpenSubKey() method in order to open the registry key for reading. Then just call GetSubKeyNames() on that to retrieve all the names of its sub keys:
Using FontKey As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts")
For Each SubKey As String In FontKey.GetSubKeyNames()
ListBox1.Items.Add(SubKey)
Next
End Using
Also put this in the top of your code file:
Imports Microsoft.Win32Regards,
Bruce- Proposed as answer by justinw812 Monday, April 12, 2021 4:02 PM
- Unproposed as answer by justinw812 Monday, April 12, 2021 4:03 PM