Ghost1372

everything can be handy

INIHelper

InIHelper class is for working with ini file in a simple way.

First Create a new IniHelper:

1
2
3
// You can use RelativePath or AbsolutePath
string filePath = "myiniFile.ini";
InIHelper iniHelper = new InIHelper(filePath);

AddValue

1
2
3
bool result = iniHelper.AddValue("key1", "test1");
bool result = iniHelper.AddValue("key2", "test2", "mySection");

ReadValue

1
2
3
Debug.WriteLine(iniHelper.ReadValue("key1"));
// OR
Debug.WriteLine(iniHelper.ReadValue("key2", "mySection"));

DeleteKey/DeleteSection

you can delete a key or section

1
2
iniHelper.DeleteKey("key2", "mySection");
iniHelper.DeleteSection("mySection");

IsKeyExists

you can check if a key exist or not

1
2
bool result = iniHelper.IsKeyExists("key1");
bool result = iniHelper.IsKeyExists("key2", "mySection");
0%