Read/write win.ini
Does anyone know how I can read/write to win.ini, please?
Tried trawling the help but can only find references to ConfigureSettings to maintain a config file related to my program. I need access to the win.ini because other programs already use that and I need to get at the data there.
Thanks.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Moses Spencer20 pointsPosted Mar 20, 2015, 1:17 AM EDT
Also here is an example how you can use it in order to retrieve all its data:
IniFile winIni = new IniFile(); winIni.Load(@"C:\Windows\win.ini"); foreach (IniSection section in winIni.Sections) { Console.WriteLine("Section's name: {0}", section.Name); foreach (IniKey key in section.Keys) Console.WriteLine("Key's name: {0} | Key's value: {1}", key.Name, key.Value); }