<p>My project requires a file where I will store key/value pair data that should be able to be read and modified by the user. I want the program to just expect the keys to be there, and I want to parse them from the file as quickly as possible.</p>

<p>I could store them in XML, but XML is way to complex, and it would require traversing nodes, and child nodes and so on, all I want is some class that takes a file and generates key value pairs. I want as little error handling as possible, and I want it done with as little code as possible.</p>

<p>I could code a class like that myself, but I'd rather learn how it's don'e in the framework than inventing the wheel twice. Are there some built in magic class in .NET (3.5) that are able to do so?</p>

<pre><code>MagicClass kv = new MagicClass("Settings.ini"); // It doesn't neccesarily have to be an INI file, it can be any simple key/value pair format.
string Value1 = kv.get("Key1");
...
</code></pre>

I don't know of any builtin class to parse ini file. I've used
nini
when needed to do so. It's licensed under the MIT/X11 license, so doesn't have any issue to be included in a closed source program.
It's very to use. So if you have a Settings.ini file formatted this way:
```
```
[Configuration]
Name = Jb Evain
Phone = +330101010101
```
```
Using it would be as simple as:
```
```
var source = new IniConfigSource ("Settings.ini");
var config = source.Configs ["Configuration"];

string name = config.Get ("Name");
string phone = config.Get ("Phone");
```
```