Skip to content

Functions

Nikolay edited this page Jan 26, 2022 · 2 revisions

Class: HubManager

Initialization:

First you need to connect the library in the "Links". After you have attached it to the project. Initialize with

(where all libraries are connected)

using INIManager;

Next, we initialize the library as an object.

HubManager name = new HubManager(@"\path\to\file.ini");

Example:

HubManager settings = new HubManager(Application.StartupPath + @"\common\settings.ini");

Functions in the library:

output: string GetString(string section, string key) - get a string from selected section and key. Example: settings.GetString("main", "nick");

WriteString(string section, string key, string value) - write a string in selected section and key. Example: settings.WriteString("main", "nick", "Sharp_Macalister");

DeleteKey(string section, string key) - delete a key from selected section. Example: settings.DeleteKey("main", "nick");

output: string array returned(string[] returned) GetSection(string section, out string returned) - get a key-value array from selected section. Example: string[] returned = settings.GetSection("main");

output: bool KeyExists(string section, string key) - check if there is such a key in the selected section. Example: settings.KeyExists("main", "nick");

RemoveSection(string section) - remove selected section from file. Example: settings.RemoveSection("main");

Clone this wiki locally