Reading ini file in C#
- by pm_2
I am trying to read an ini file that has the following format:
SETTING=VALUE
SETTING2=VALUE2
I currently have the following code:
string cache = sr.ReadToEnd();
string[] splitCache = cache.Split(new string[] {"\n", "\r\n"}, StringSplitOptions.RemoveEmptyEntries);
Which gives me a list of settings, however, what I would like to do is read this into a dictionary. My question is, is there a way to do this without iterating through the entire array and manually populating the dictionary?