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:
We'll now make a registrykey variableCode:Imports Microsoft.Win32
Now we will make sure the location want it stored in that variableCode:Dim FF_key As RegistryKey
Basically what that is doing is it's going to look like the tree in the regeditor: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:
Then: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
The ("numbers") is the key name which holds the information that I wanted.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")
Now when it comes to writing it's just as easy:
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.Code:FF_key.SetValue("0034", 1, RegistryValueKind.DWord
Hope this helps


 
			
			![[VB.NET] Reading and Writing to the Registry](https://www.consolediscussions.com/forum/staff/Elite.png) 
			
 
					
				
 
					
					
					
						 Reply With Quote
  Reply With Quote
Bookmarks