Link to home
Start Free TrialLog in
Avatar of martin05
martin05

asked on

Read INI file

Can someone tell me how to read an in file that has multiple values in each section from within a windows application  ?


e.g
[Servers]
ServerName 1=Server1
ServerName 2=Server2
ServerName 3=Server3
Avatar of rawinnlnx9
rawinnlnx9
Flag of United States of America image

Avatar of martin05
martin05

ASKER

rawinnlnx9 thanks for the reply thats fine I can read the ini file for a single value, but how do you do it for multiple values ?


 INIFile ini = new INIFile("C:\\config.ini");

            for (int i = 0; i < ??????????; i++)
            {
                ini.Read ??("Server 1,???????????")
            }

ASKER CERTIFIED SOLUTION
Avatar of Dmitry G
Dmitry G
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I got 2 different solutions to my problem .
Both will work so splitting the points

Thanks for your help guys