|
-
Nov 8th, 2003, 04:02 PM
#1
Thread Starter
Addicted Member
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!
-
Nov 8th, 2003, 05:55 PM
#2
Addicted Member
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)
-
Nov 8th, 2003, 06:22 PM
#3
Thread Starter
Addicted Member
Ok thank you very much. I figured it out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|