Skip to content

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.

License

Notifications You must be signed in to change notification settings

MikedaSpike/IniFile.Utility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

INI File Utility

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.

Features

  • 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.

Installation

  1. Clone the repository:
    git clone https://github.com/MikedaSpike/inifile-utility.git
  2. Open the project in Visual Studio.
  3. Build the solution to restore dependencies.

Usage

Loading an INI File

Dim ini As New DracLabs.IniFile()
ini.Load("path/to/yourfile.ini")

Saving an INI File

ini.Save("path/to/yourfile.ini")

Adding a Section

Dim section As DracLabs.IniFile.IniSection = ini.AddSection("NewSection")

Adding a Key

Dim key As DracLabs.IniFile.IniSection.IniKey = section.AddKey("NewKey")
key.Value = "NewValue"

Removing a Section

ini.RemoveSection("SectionName")

Renaming a Section

ini.RenameSection("OldSectionName", "NewSectionName")

Renaming a Key

section.RenameKey("OldKeyName", "NewKeyName")

Getting a Key Value

Dim value As String = ini.GetKeyValue("SectionName", "KeyName")

Setting a Key Value

Dim success As Boolean = ini.SetKeyValue("SectionName", "KeyName", "NewValue")

Removing All Sections

Dim success As Boolean = ini.RemoveAllSections()

History

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.

Usage

Contributions are welcome! Please fork the repository and submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published