A VB.NET class for managing INI files, preserving the original order of sections and keys, with methods for loading, saving, adding, removing, and renaming entries.
- Load INI Files: Read and parse INI files into structured objects.
- Save INI Files: Write INI file data back to disk, preserving the original order.
- Manage Sections and Keys: Add, remove, and rename sections and keys.
- Preserve Order: Maintain the original order of sections and keys, appending new entries to the end.
- Clone the repository:
git clone https://github.com/MikedaSpike/inifile-utility.git
- Open the project in Visual Studio.
- Build the solution to restore dependencies.
Dim ini As New DracLabs.IniFile()
ini.Load("path/to/yourfile.ini")ini.Save("path/to/yourfile.ini")Dim section As DracLabs.IniFile.IniSection = ini.AddSection("NewSection")Dim key As DracLabs.IniFile.IniSection.IniKey = section.AddKey("NewKey")
key.Value = "NewValue"ini.RemoveSection("SectionName")ini.RenameSection("OldSectionName", "NewSectionName")section.RenameKey("OldKeyName", "NewKeyName")Dim value As String = ini.GetKeyValue("SectionName", "KeyName")Dim success As Boolean = ini.SetKeyValue("SectionName", "KeyName", "NewValue")Dim success As Boolean = ini.RemoveAllSections()This code was originally created by Draco and Adultery based on Ludvik Jerabek and was shipped with the PinballX plugin template. 5Cutters and Mike Da Spike modified it for use with the Database Manager and are now sharing it.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.