Nini Library API Reference -

IniReader Class

Fast forward only INI parser class.

For a list of all members of this type, see IniReader Members.


public class IniReader : IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.


An INI is a file is a simple file format for storing configuration information. These files are line based. Each line can be one of three types: empty, section, or key/value pair. All of these formats allow for comments. Comments are delimited by hash mark ('#') or a semi-colon (';').


IniReader reader = new IniReader ("test.ini");
string comment;
while (reader.Read ())
    comment = (reader.Comment.Length > 0) ? " ; " + reader.Comment : "";

    switch (reader.IniType)
    case IniType.Empty:
        Console.WriteLine (comment);
    case IniType.Section:
        Console.WriteLine ("[" + reader.Name + "]") + comment;
    case IniType.Key:
        Console.WriteLine (reader.Name + " = " + reader.Value + comment);
reader.Close ();


Namespace: Nini.Ini

Assembly: Nini (in Nini.dll)

See Also

IniReader Members | Nini.Ini Namespace | The System.Math class