C#-VB : Registry editing
Hello, in this tutorial I'll teach you how you can edit the registry in visual basic 2008/2010 and C#2008/2010.
Do not attempt to change any values in the registry if you do not know what the registry is or if you cannot work with it, vsprogramming.com cannot be hold responsible for your acts.
Visual Basic:
1. Start by opening a new project and call it registry editor or call it whatever you want.
2. Double click at Form1 and you should now get in the coding part.
3. Add Imports Microsoft.Win32 at the top of the coding section
To change a certain value, or to add a certain value in the registry we use the following code:
Registry.Setvalue()
Example:
Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\CurrentVersion\Run", "NEWVALUE OR CHANGEVALUE", "THEVALUE")
this code will add or change a value in the startup of the registry.
C#:
1. Start by opening a new project and call it whatever you want.
2. Double click at form1 and you should now get in the coding section.
3. Scroll to the top of the coding, as a standard you should see this:
now you want to add a new "using.." code ;
using Microsoft.Win32;
Add a new component (button,...). If you want to change or add a value in the registry, use the following code:
Registry.SetValue(@"HKEY_CURRENT_USER\...\...\...", "ValueToChangeOrAdd", "Value");
Just change the characters between the "" and you'll be changing the values.
Topic: C#-VB : Registry editing
No comments found.