Library for reading and writing INI files.
INI files are broken up into discrete sections of settings with values. Each section and setting name are case sensitive but accept spaces.
Begin by defining a new INI file
IniFile iniFile = new IniFile(filePath);
To read settings you provide the name of the section in the file, and the name of the setting in the section.
var setting = iniFile.ReadSetting("global", "color");
Or read all settings in a section at once with
var settings = iniFile.ReadSettings("global");
To write settings you provide the name of the section, and an instance of the Setting class, which has an identifying name and a setting value.
iniFile.WriteSetting("global", new Setting("color", value));
You can also write an entire section of settings at once as shown below.
// Create a list of settings
var settings = new List<Setting>
{
new Setting("color", value),
new Setting("name", "sam")
};
// Write the settings to the global section
iniFile.WriteSettings("global", settings);