• Hello Guest! Welcome to ConsoleCrunch, to help support our site check out the premium upgrades HERE! to get exclusive access to our hidden content.
  • Unable to load portions of the website...
    If you use an ad blocker addon, you should disable it because it interferes with several elements of the site and blocks more than just adverts.
  • Read Rules Before Posting Post Virus Scans with every program.

[VB.NET] Reading and Writing to the Registry

1UP

Member
This is a piece from my Final fantasy 11 Configurator that I made back when I used to play the game.

Start off with the imports:
Code:
Imports Microsoft.Win32

We'll now make a registrykey variable
Code:
  Dim FF_key As RegistryKey

Now we will make sure the location want it stored in that variable

Code:
 FF_key = Registry.LocalMachine.OpenSubKey("\Software\Microsoft\", True)

Granted I no longer have the game installed, I'm sure you will still get the point.

Now to read in the Keys that are already saved by the game. In this part I called a few keys that I wanted information from, so in order to do that I first declare my variables:

Code:
  Dim key_windowed_mode As String
  Dim key_res_1 As String
  Dim key_res_2 As String
  Dim key_3D_res_1 As String
  Dim key_3D_res_2 As String
  Dim key_texture_compress As String
  Dim key_on_screen_map As String

Then:

Code:
  key_res_1 = FF_key.GetValue("0001")
  key_res_2 = FF_key.GetValue("0002")
  key_3D_res_1 = FF_key.GetValue("0003")
  key_3D_res_2 = FF_key.GetValue("0004")
  key_texture_compress = FF_key.GetValue("0018")
  key_on_screen_map = FF_key.GetValue("0019")

The ("numbers") is the key name which holds the information that I wanted.


Now when it comes to writing it's just as easy:

Code:
 FF_key.SetValue("0034", 1, RegistryValueKind.DWord

Valuekind.dword is just the datatype, you don't always needs to do this but for this to work for me in this case I had to.

Hope this helps
 
This is a piece from my Final fantasy 11 Configurator that I made back when I used to play the game.

Start off with the imports:
Code:
Imports Microsoft.Win32

We'll now make a registrykey variable
Code:
  Dim FF_key As RegistryKey

Now we will make sure the location want it stored in that variable

Code:
 FF_key = Registry.LocalMachine.OpenSubKey("\Software\Microsoft\", True)

Basically what that is doing is it's going to look like the tree in the regeditor:
regx.jpg


Granted I no longer have the game installed, I'm sure you will still get the point.

Now to read in the Keys that are already saved by the game. In this part I called a few keys that I wanted information from, so in order to do that I first declare my variables:

Code:
  Dim key_windowed_mode As String
  Dim key_res_1 As String
  Dim key_res_2 As String
  Dim key_3D_res_1 As String
  Dim key_3D_res_2 As String
  Dim key_texture_compress As String
  Dim key_on_screen_map As String

Then:

Code:
  key_res_1 = FF_key.GetValue("0001")
  key_res_2 = FF_key.GetValue("0002")
  key_3D_res_1 = FF_key.GetValue("0003")
  key_3D_res_2 = FF_key.GetValue("0004")
  key_texture_compress = FF_key.GetValue("0018")
  key_on_screen_map = FF_key.GetValue("0019")

The ("numbers") is the key name which holds the information that I wanted.


Now when it comes to writing it's just as easy:

Code:
 FF_key.SetValue("0034", 1, RegistryValueKind.DWord

Valuekind.dword is just the datatype, you don't always needs to do this but for this to work for me in this case I had to.

Hope this helps
Image is broken......
 
Meant to remove that when I posted it. The original post was from years ago and those images are long gone. Good thing they aren't really required.
yeah i just wanted to make sure you knew ;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • @ God:
    I’ve been messing and working with trying to make great CSS for the names. Like Staff Premium news writer etc..
  • @ QM|T_JinX:
    ok so hows that going /
  • @ God:
    It’s going good. So we will see what happens and if the site can come back like it was or better
  • @ QM|T_JinX:
    nice yea lets hope
  • @ QM|T_JinX:
    im going to play some red dead it was great to have spoken to you bro nice to see you back on here
  • @ QM|T_JinX:
    hope you have a great night bro
  • @ God:
    It was good talking with you as well, you have a great night! We will talk later bro
    +1
  • Chat Bot:
    QM|T_JinX has joined the room.
  • @ QM|T_JinX:
    have a great weekend everybody ill be back after the weekend
  • Chat Bot:
    OkBrruh is our newest member. Welcome!
  • Chat Bot:
    uncrtin is our newest member. Welcome!
  • Chat Bot:
    BigTechModz is our newest member. Welcome!
  • @ BigTechModz:
    Hey this is RexMods I don’t remember the login to my old account so I made a new one I am now known as BigTechModz
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    iDior2K is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    KillerDino49 is our newest member. Welcome!
  • Chat Bot:
    Xiomber is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    QM|T_JinX has joined the room.
  • Chat Bot:
    051magalhães is our newest member. Welcome!
  • Chat Bot:
    wheelcore is our newest member. Welcome!
  • Chat Bot:
    QM|T_JinX has joined the room.
      Chat Bot: QM|T_JinX has joined the room.
      Back
      Top