ini 1.0.0
See the version list below for details.
dotnet add package ini --version 1.0.0
NuGet\Install-Package ini -Version 1.0.0
<PackageReference Include="ini" Version="1.0.0" />
paket add ini --version 1.0.0
#r "nuget: ini, 1.0.0"
// Install ini as a Cake Addin #addin nuget:?package=ini&version=1.0.0 // Install ini as a Cake Tool #tool nuget:?package=ini&version=1.0.0
Usage:
/* An INI file content :
;Comment
[Section]
key=value
*/
var iniFile = new Ini(filePath); // Initialize a ini file. if the file exists, it is loaded automatically, otherwise it will be an empty ini file that will be written in.
// Read ini
// If the key does not exists, an empty string is returned.
// Keys and sections are case insensitives
string[] keys = iniFile.GetKeys("section"); // Get all the sections of the ini file
string[] sections = iniFile.GetSections(); // Get all the keys names in a section
var s = iniFile.GetValue("key"); // Get a key value out of a section
var s = iniFile.GetValue("key", "section"); // Get a key value in a section
var s = iniFile.GetValue("key", "section", "default value"); // Get a key value or a default value
Load(); // Reloads a ini file
// Write ini
// Keys and sections are case insensitives
iniFile.WriteValue("key", "value"); // Add or update a key value out of a section
iniFile.WriteValue("key", "section", "value"); // Add or update a key value in a section
Save(); // Save the modified ini file to the disk
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 3.5
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.