Nini Library API Reference - http://nini.sourceforge.net/ |

# IniReader Class

Fast forward only INI parser class.

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

System.Object
Nini.Ini.IniReader

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.

#### Remarks

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 (';').

#### Example

    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);
            break;
        case IniType.Section:
            Console.WriteLine ("[" + reader.Name + "]") + comment;
            break;
        case IniType.Key:
            Console.WriteLine (reader.Name + " = " + reader.Value + comment);
            break;
        }
    }
    reader.Close ();

#### Requirements

Namespace: Nini.Ini

Assembly: Nini (in Nini.dll)

#### See Also

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