Skip to content

Edit a ini file

X-rays5 edited this page Feb 9, 2022 · 4 revisions

Adding values

// Adding a section
inireader.AddSection("foo");

// Adding a member to a section
inireader["foo"].Add("foo", "bar");

// These actions can also be chained
inireader.AddSection("foo").Add("foo", "bar");

Setting values

// Set root section value
inireader.GetRootSection()["bar"] = 1234;

// Set member section value
inireader["foo"]["bar"] = 1234;

Removing values

// This will remove the given section and all of It's data
inireader.RemoveSection("foo");

// This will remove the member from the given section
inireader["foo"].Remove("bar");

// Remove all member from section
inireader["foo"].RemoveAll();
Clone this wiki locally