ini 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ini --version 1.0.0
NuGet\Install-Package ini -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ini" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ini --version 1.0.0
#r "nuget: ini, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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

There are no supported framework assets in this package.

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.

Version Downloads Last updated
1.0.7 27,862 7/2/2013
1.0.6 1,520 7/2/2013
1.0.5 1,341 6/12/2013
1.0.4 1,339 6/12/2013
1.0.3 1,270 6/12/2013
1.0.2 1,283 6/12/2013
1.0.1 1,322 6/12/2013
1.0.0 1,434 6/12/2013