[TuToRiAl] The Registry + Visual Basic (Part 1) - 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] The Registry + Visual Basic (Part 1) (/showthread.php?tid=12411) |
[TuToRiAl] The Registry + Visual Basic (Part 1) - Resistance - 10-03-2010 Hello everyone. This will be a simple tutorial on how to use common registry commands that can bond in to your application. We will be going over the following: 1) Adding a Registry Key to the Registry 2) Removing a Registry Key ----------------------------------------------- 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. 1) Adding a Registry Key First things first, add to the very top of the code form, Imports Microsoft.Win32. Code: Imports Microsoft.Win32 Now for the Button1 Code: Below is a condensed version for the code or CURRENT_USER Directory in the Registry. Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Now here is something you NEVER knew about. The value type, is it DWord? QWord? Binary? String? MultiString? ExpandString or even Unknown? Below is a code of writing a key into a specific place in the registry. Code: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click 2) Removing a Registry Key Now we will remove the registry key we created in the first place. Code: Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Now if we had taken off the Worked and My Reg Key + RegistryValueKind.DWord and it wouldv'e looked like this: Code: Registry.CurrentUser.DeleteValue("RandomKey") ' Thus deleting the actual key. THE END. I hope this might have helped you guys... somewhat RE: [TuToRiAl] The Registry + Visual Basic - ruk00112 - 10-03-2010 Great tutorial pal. Thanks for sharing this with us and ill try this out asap. The thread is made nicely and you have done a very good job with it. Nice work pal RE: [TuToRiAl] The Registry + Visual Basic - Wynston - 10-03-2010 Awesome tutorial, This is probably the best / easiest way to edit the redistry with vb.net RE: [TuToRiAl] The Registry + Visual Basic - Resistance - 10-03-2010 I will add one more, editing the value and reading the regkeys value in a snap, great for getting certain information on a specific program, software or even your computer. RE: [TuToRiAl] The Registry + Visual Basic - AceInfinity - 10-03-2010 In any Registry Tutorial, you can't forget to post how to make BACKUPS. It's the most important thing anyone needs to know if you make any changes at all period. Extracting a key and saving it for later. RE: [TuToRiAl] The Registry + Visual Basic - Resistance - 10-03-2010 Well, I was creating a Test Key, but thank you captain for telling me the ship is sinking atm. LOL RE: [TuToRiAl] The Registry + Visual Basic - AceInfinity - 10-03-2010 (10-03-2010, 06:35 PM)L3g1tWa5te Wrote: Well, I was creating a Test Key, but thank you captain for telling me the ship is sinking atm. LOL Like I said, i'm not here to bash all your good tutorials they are good contributions, i'm just making notes of things that are also important to your tutorials lol. Even if you create your own key, there can be conflicts RE: [TuToRiAl] The Registry + Visual Basic - Resistance - 10-03-2010 (10-03-2010, 06:39 PM)Infinity Wrote: Like I said, i'm not here to bash all your good tutorials they are good contributions, i'm just making notes of things that are also important to your tutorials lol. Rarely, if your computer is thinking 1+1 = 3 then possibly... yes. But I like your input its helpful... I have so many tutorials to post but i'm not going to post them all in one shot. People think its spam and it is so... 2 a day out of one hundred and increasing lol. RE: [TuToRiAl] The Registry + Visual Basic - phire nuk3r - 10-05-2010 Thank you for the share. Every little helps. RE: [TuToRiAl] The Registry + Visual Basic - ☼Parker☼ - 10-05-2010 This is definitley a good tut for me very useful |