Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27203

How to Add & Delete Keys from Registry (Using a ListView)?

$
0
0
Hi everyone, I am trying to learn how to Add from ListView to Registry, and how to Delete from ListView and Register!

Example of my Folder in Registry:
Code:

HKEY_CURRENT_USER\Main\Users\John
As you can see JOHN is only one of the users out of 20 user in the "Users" folder (in Registry)! I know how to get all the users by a single click, but How can I add them back in Registry the same way by a single click and into the same folder!

And how can I Delete them 1 by 1 in from Listview & Registry, or delete multiply!

This is my Code how I get the Keys or Users from Registry:
Code:

     
        Dim RegKey As RegistryKey = Registry.CurrentUser
              RegKey = RegKey.OpenSubKey("Main\Users")
              Dim subkeyNames As [String]() = RegKey.GetSubKeyNames()
        For Each s As [String] In subkeyNames
                ListView1.Items.Add(s)
        Next

So my 2 Questions are:
1) How to add from ListView to Registry (By a Single Click) ?
2) How to Delete 1 by 1 from ListView that deletes from Registry ?

I will be appreciate your help in this case, I tried so many ways but failed! Thanks a lot in advance!

Viewing all articles
Browse latest Browse all 27203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>