Cinchoo is the application framework for .NET. One of the feature it exposes is an API to read and write INI file. This article reveals in particular of reading and storing Hierarchical INI sections. It gives an opportunities to contain INI sections within another INI section.
Please download latest Cinchoo binary from here.
How to use
For a sample INI file below
;This is a test hierarchical INI file.
;To test its functionality.
CORP1=JP Morgan Chase
In the above sample INI file, the Hierarchical sections are given with ‘/’ separator. ‘CORPORATIONS’ section contains ‘FINANCE’ and ‘TECHNOLOGY’ subsections. There are couple ways, we can access them programmatically.
using (ChoIniDocument iniDocument = ChoIniDocument.Load(@"Sample.ini"))
Sample project is attached for download. Try for yourself. Thanks.