Hi,
I want to store and retrieve the content of a listbox in registry. Now i am storing the content in a flat file and retrieving it. How to make use of the registry.
Printable View
Hi,
I want to store and retrieve the content of a listbox in registry. Now i am storing the content in a flat file and retrieving it. How to make use of the registry.
Why use the registry? That method was OK in the past, but now too many programs are filling up the registry with bloat. You'd do better keeping the flatfile, or using an INI file. Any reason for the change?
The easiest way to save data to the registry is with GetSetting and SaveSetting.
Is the reason for the change security?
It's easier to encrypt the flat file. That is 100% more secure.
I am going to distribute my application as an exe. In my application i will get some files which is to be displayed(say some wav files). Now i am creating a flat file in the application path and storing the details and retrieving it, which i dont want to expose to user. So i need to store it in registry and retrive it. could you plz suggest some codes to store and retrieve from registry
You could you the GetSetting and SaveSetting methods to write to the registry.
They write to "HKEY_CURRENT_USER\Software\VB and VBA Program Settings".
HTHVB Code:
SaveSetting App.Title, "Settings", "WavInfo", "C:\MyWav.wav" 'Then to retrieve: 'If you specify a value for the Default parameter, if no value is found it will use the parameter you specified GetSetting App.Title, "Settings", "WavInfo", "C:\Default.wav"