Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read and write to the registry with VB.NET

I made a game and I would like to store the high score and other values in the windows registry. It's made in VB.NET. Could someone give me a sample code example of simple reading and writing to the registry.

Thanks

like image 910
jmasterx Avatar asked Aug 09 '09 02:08

jmasterx


2 Answers

Writing

Reading

Links found using Google.

like image 124
Rob Avatar answered Sep 24 '22 22:09

Rob


Simply...

  Imports Microsoft.VisualBasic

  Dim s As String

  SaveSetting("(AppName)", "(SectionName)", "(Key)", "(Your Value)")

  s = GetSetting("(AppName)", "(SectionName)", "(Key)", "(Default Value)")

Replace (AppName), (SectionName), (Key) with appropriate values. The data will be saved in HKEY_CURRENT_USER\Software\VB and VBA Program Settings\(AppName)

like image 31
Bill Avatar answered Sep 25 '22 22:09

Bill