Uhm, the original of this drawing is already given to a friend of mine. Luckily, I'd saved a copy in my computer.
Tuesday, August 26, 2008
Monday, August 25, 2008
Encrypt value
Some confidental information as password, mostly need to be encrypted. Here I have a simple coding in VB 2005. To decrypt, just need to make the same code with encrypt, then change to it's opposition code. If in encrypt using *2 (times 2), then in decrypt using /2 (divided by 2). Here is an example of encrypt code. Try it yourself...
----------------------------------------------------------------------------------
For i = 1 To Len(Password)
Result = Result & Chr(Asc(Mid(Password, i, 1)) * 2)
Next
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
For i = 1 To Len(Password)
Result = Result & Chr(Asc(Mid(Password, i, 1)) * 2)
Next
----------------------------------------------------------------------------------
Simple code to save n retrieve data from registry
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.
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.
Subscribe to:
Posts (Atom)