Posted by John, DelphiLand Team on August 09, 2008
In Reply to Re: Write/copy ini section to registry posted by Bobp12404 on
August 09, 2008
: : I can save some configuration settings for my app to an ini file for loading when the app starts
up. I would like to be able to save those same settings to the registry, optionally loaded from the
ini files. Can someone explain to me how to load the ini/text file to the registry using name/value
pairs? The ini structure is something like the following:
: : [XSettings]
: : color=blue
: : color=red
: : color=green
: : [YSettings]
: : range=high
: : range=mid
: : range=low
: : [Zsettings]
: : when=before
: : when=now
: : when=after
: : Sorry, forgot to add where in the registry. I 'think' the following keys would be appropriate:
: :
HKEY_CURRENT_USER\Software\MyApp\XSettings
: : HKEY_CURRENT_USER\Software\MyApp\YSettings
: : HKEY_CURRENT_USER\Software\MyApp\ZSettings
In an Ini-file, no entries can have the same value for "Section" as well as for "Ident" (Key). So I assume that in your description of the ini structure:
[XSettings] color=blue color=red color=green
...you mean that [XSettings]color can have one of the following 3 string values: 'blue', 'red' or 'green'?
And the same for the other 2 Sections/Ident parts: [YSettings]range and [Zsettings]when ?
...or do you mean something else?
Best regards,
John, DelphiLand Team
Related articles
Follow Ups