Results 1 to 3 of 3

Thread: writing/reading to registry

  1. #1

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219

    writing/reading to registry

    Hi, I have a login for all my programs that uses a XML file to store the regstraion code. So everytime the program is run it doesnt need to show the login screen. BUT this creates a problem everytime i offer an update because evryone needs thier registration codes again. So i want to store the reg code in the registry instead of the XML so that the udated program will just read the registry and it will then load up. So i need to know how to write the code to the registry and then read it. Thanks a lot!
    -Rob

  2. #2
    Addicted Member GSIV's Avatar
    Join Date
    Jun 2002
    Location
    Texas, USA
    Posts
    213
    Maybe this code can get you started. I found it at http://'http://msdn.microsoft.com/li...omregistry.asp


    'Delete a key in HKEY_CURRENT_USER

    Dim key As Microsoft.Win32.RegistryKey

    key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SubKey", True)

    key.DeleteValue("Name")



    'Create a key in HKEY_CURRENT_USER

    Dim key As Microsoft.Win32.RegistryKey

    key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("SubKey")

    key.SetValue("Name", " Value")



    'Read a key from HKEY_CURRENT_USER

    Dim key As Microsoft.Win32.RegistryKey

    key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SubKey")

    Dim name As String = CType(key.GetValue("Name"), String)

  3. #3

    Thread Starter
    Addicted Member VBGangsta's Avatar
    Join Date
    Aug 2003
    Location
    New York
    Posts
    219
    Ok thank you very much. I figured it out
    -Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width