Heisenberg Heisenberg - 4 months ago 10
Ini Question

How to update specific ini key in specific section?

I'm using this library: https://github.com/rickyah/ini-parser/wiki/First-Steps
I can't figure out how can I update a specific key in a specific section. In particular:

[UI]
fullscreen = false


how can I change
fullscreen = true
?

Answer

Try this:

var parser = new FileIniDataParser();
IniData data = parser.ReadFile("YourConfiguration.ini");
data["UI"]["fullscreen"] = true.ToString().ToLower();
parser.WriteFile("YourConfiguration.ini", data);