IniFile to HashStringList
Posted on 2004-09-15
Does anyone have a function/procedure on how to read through an ini file into a THashStringList?
I've got an ini file which contains registration information and database settings for programs. This file get's decrypted, read, then re-encypted. This works fine in my user registration dll, however I'd have to rewrite the encypt/decrypt routines into each application, this is not efficient. And I'd rather not have to keep un-encrypting the inifile as I don't want end-users to even really look at it at all, but instead use my GUI.
I figure the best way to do this would be to have a function in a DLL called LoadIniFile and call it on start of my program to load the IniFile into a HashStringList in the .dll (I have a unit for storing information globally). I can then have a function called GetIniValue which accepts a string and returns a string (This does restrict me to not having 'Sections' like an IniFile normally would do), unless a 3d HashStringList can be created rather than a 2d? Anyway my question is how to read an IniFile into a HashStringList.