Sometimes, we need to use registry to save some information of a system. That's better than using text file which can be removed easily by user. Here I have simple code in VB 2005 to make it. Just using SaveSetting and GetSetting. SaveSetting for save the value and GetSetting for retrieve the saved value.
Example:
SaveSetting "MySystem", "UserManagement", "Server", "Elini"
servername=GetSetting "MySystem", "UserManagement", "Server"
To see where the value is saved, follow steps below:
1. On the start menu, choose and open Run...
2. type regedit and click OK button
3. Open HKEY_CURRENT_USER -> Software -> VB and VBA Program Setting
4. There will have a folder MySystem -> User Management as set before in SaveSetting code
5. Open the folder and there will have variable name (in this case will be "Server") and the saved value.
No comments:
Post a Comment