Simple INI file parser library written in C# (.NET Standart v2.1).
The basic element contained in an ini file is the key. Every key has a name and a value, delimited by an equals sign '='. The name appears to the left of the equals sign.
The characters equal sign '=' or semi colon ';' or '#' are reserved characters, and cannot be used in section names, key names or key values.
Section and key names are case sensitive.
Start of line comments and inline comments using ';' or '#' character are ignored.
var ini = new IniParser(iniFilePath);
string? keyValue = ini.GetValue("Section", "Key"); // returns null, if key doesn't exist
ini.SetValue("Section", "Key", "Value");
ini.DeleteKey("Section", "Key"); // returns true, if existing key was deleted
Dictionary<string, string?> keysAndValues = ini.GetSectionKeysAndValues("Section");
ini.SaveIni();
Enable/disable ini file autosave functionality. No need to call SaveIni method after SetValue or DeleteKey after class has been instantiated:
ini.EnableIniAutoSave();
ini.DisableIniAutoSave();
ini.ReloadIni();