ChoIniDocument
In this section, I’ll show you how you can store and read multiline values from Ini file. According to INI specification, multiline INI values are supported. In the below sample, ADDRESS section value is specified as multiline value. \ char is used to break the line in the unquote-ted value.
;This is a test INI file. [PRODUCT] VERSION=1.002 ;Version Comment COMPANY=NAG Groups LLC ADDRESS=10 River Road, \ Orlando, \ FL 100230.
Alternatively you can give multi-line value in quotes as below
;This is a test INI file. [PRODUCT] VERSION=1.002 ;Version Comment COMPANY=NAG Groups LLC ADDRESS="10 River Road, Orlando, FL 100230."
Try and see the value returned from the below statement…
using (ChoIniDocument iniDocument = ChoIniDocument.Load(@"C:\Temp\TestIni1.ini")) { Console.Writeline(iniDocument["PRODUCT"]["ADDRESS"]); }