[TuToRiAl] How to Get/Edit the value of a key in the Registry (Part 2) - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19) +---- Thread: [TuToRiAl] How to Get/Edit the value of a key in the Registry (Part 2) (/showthread.php?tid=12665) |
[TuToRiAl] How to Get/Edit the value of a key in the Registry (Part 2) - Resistance - 10-10-2010 Hello everyone, your tutorial guru, legitwaste here... Today we are going to learn how to edit and read a registry key, extremely simple, unless you want to make it complicated for yourself lol. WARNING: You Must Be Running the Application as an Administrator if you are using Windows Vista/7, XP Users need to use this technique only when accessing the LOCAL_MACHINE. Now add 2 buttons and 2 textboxes to your form so that they look like this: Now for the coding. As usual we must import ms.win32 Code: Imports Microsoft.Win32 Next we will edit the code of "read a value" a.k.a. Button1. We are trying to find and then edit the value of the string, Test. As you can see the value is "SupportForumsRocks". Lets see if we can make it work. Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click It works! Now for the second button a.k.a. Edit the value, in vb known as "set". Code: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Now the results should be like this: Then after setting the value to HFrox, And that is how you are able to read and edit the value of a registry key. |