/IniFile

DLL that allow work with ini-files in C#.

Primary LanguageC#

IniFile

Build status

DLL that allow work with ini-files in C#.

Usage

  1. Download the latest release;
  2. Add reference to Ini.dll (or you can just take Ini.cs from source and add it directly in your project, then you don't need an dll);

Example

using Ini;
...
private readonly IniFile _settings;
...
public YouConstructor()
{
  // load settings
  this._settings = new IniFile( "Path_To_Your_Ini.ini" );
}
...
// somewhere in your app

// read (default value can be of the following type: string, int, bool, double)
int myDefaultInt = 4;
int myVar = this._settings.Read( "Key", "Section", myDefaultInt );
string myStr = this._settings.Read( "MyKey", "Section2", "defaultSrting" );

// write
this._settings.Write( "Key", 5, "Section" );
this._settings.Write( "Key", "str", "Section2" );