Registry, to some, sounds like a big scary monster that'll f*ck your computer up and make you its b*tch. Not true, it is mostly used for settings and device info, I'm sure if you delete something, it'll pop back up sooner or later... but same can't be said for everything in the registry.
Before any of this, your program will need administration rights, so you'll need to edit the manifest, to do so, go to your project properties, click 'View Windows Settings', and change <requestExecutionLevel> to "requireAdministrator".
Registry is great for finding out computer information, such as Processor, Motherboard, GPU, Current Network name, Playback & Recording device name, and is also great for adding unfindable settings, without using an ini file (which can be a pain, trust me), using the following code
this creates a key, but the values are not automatically added, so you can add one usingCode:My.Computer.Registry.CurrentUser.CreateSubKey("KeyNameHere")
You can rename values, but it can be hard to do.Code:My.Computer.Registry.SetValue("HKEY_CURRENT_USER\KeyNameHere", "NameOfValue", "Value")
You can also delete keys, but I'm not gonna scratch that surface with a 30 foot pole.Code:Dim TestKey = My.Computer.Registry.CurrentUser.OpenSubKey("KeyNameHere", True) TestKey.SetValue("NameOfValue", "NewValue") TestKey.Close()
Does a key exist? You can do that too.
The code added Is Nothing, but you can remove that to swap the does not exist and exists code around if you find it easier.Code:If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\KeyNameHere", "NewValue", Nothing) Is Nothing Then 'It does not exist. Else 'It Exists End If
Do you want to save settings of a program? Don't want them to save settings? Does your program cost 4000 dollars? *Cough* Microsoft *Cough* Well, with registry, you can do that! but hide it well... Let's hide it in... say... Internet Explorer, nobody ever looks through there...
This is just scratching the surface of registry, I'm sure you can do much much more with registry than this.Code:My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "IsPremium", "True")
Last edited by ecaep42; 10-07-2013 at 09:41 PM.
HOW TO GET A ADMIN/MODS ATTENTION:
1) Find a reason to get their attention.
2) Post a outside link to a broken file (Such as Med-ia Fire, Mega, and even youtube (Since they hate outside links so much)).
3) Yell and call other people ******s
4) Become a closet homosexual
5) Watch as the mods try to ban you, but cant because its a fake url and they fell for your trick.
6) Report them to a higher-admin.
7) Watch them get demoted and banned
ᕙ( ͡° ͜ʖ ͡°)ᕗ OBEY MY DOG ᕙ( ͡° ͜ʖ ͡°)ᕗ
[url]https://www.youtube.com/watch?v=7cw2DllsZmc]https://www.youtube.com/watch?v=7cw2DllsZmc[/video]