zendar zendar - 1 month ago 7
Ini Question

Reading/writing an INI file

Is there any class in the .NET framework that can read/write standard .ini files:

[Section]
<keyname>=<value>
...


Delphi has the
TIniFile
component and I want to know if there is anything similar for C#?

Answer

The creators of the .NET framework want you to use XML-based config files, rather than ini files. So no, there is no builtin mechanism for reading them.

There are third party solutions available though. Take a look at An INI file handling class using C#.