IniFileIO 1.4.0.6028
dotnet add package IniFileIO --version 1.4.0.6028
NuGet\Install-Package IniFileIO -Version 1.4.0.6028
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="IniFileIO" Version="1.4.0.6028" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IniFileIO --version 1.4.0.6028
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: IniFileIO, 1.4.0.6028"
#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 IniFileIO as a Cake Addin #addin nuget:?package=IniFileIO&version=1.4.0.6028 // Install IniFileIO as a Cake Tool #tool nuget:?package=IniFileIO&version=1.4.0.6028
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
IniFileIO
.NET object class for handling creation, reading, and writing of INI Files.
Features:
- Full read/write/creation support.
- Easy to use: most operations can be done with a single line of code.
- Supports comments at the section and key level.
- Supports implied and manual ordering of sections and keys.
- Full intellisense comments included.
Important Notice
The save operation will refactor existing INI files according to the object's style logic (which should be pretty standard).
Usage Example
Assuming the following contents for "MyFile.ini".
[Section 1]
Key1=This value
Key2=That value
[Section 2]
Key1=Section key
Another key=Here
Sample in VB.NET
Dim iniTest As New IniFileIO.IniFile("MyFile.ini")
With iniTest
' value1 is set to 'This value'.
Dim value1 As String = .GetKeyValue("Section 1", "Key1")
' value2 is set to 'That value'.
Dim value2 As String = .GetKeyValue("Section 1", "Key2",
defaultValue:="n/a")
' value3 is set to 'n/a'.
Dim value3 As String = .GetKeyValue("Section 1", "Key3",
defaultValue:="n/a")
If value3 = "n/a" Then
value3 = "This and That value"
End If
.SetKeyData("Section 1", "Key2",
value:=value2 & "-updated")
' Default behavior is to create if the path doesn't exist.
' 'Key3' will be added to 'Section 1'.
.SetKeyData("Section 1", "Key3",
value:=value3)
' 'Key3' does not exist in 'Section 2' and the option to
' automatically create is disabled.
.SetKeyData("Section 2", "Key3",
value:="Will not be created.",
createIfNotExist:=False)
' 'New Section' and the specified keys will be created.
.SetKeyData("New Section", "New Key 1",
value:="Created key 1",
comments:="This key did not previously exist.")
.SetKeyData("New Section", "New Key 2",
value:="Created key 2",
comments:="This key didn't exist either.")
' Update the comments on the newly created section.
.SetSectionData("New Section",
comments:="This section was created on the fly.")
' Push all changes.
.SaveFile()
End With
New contents of "MyFile.ini".
[Section 1]
Key1=This value
Key2=That value-updated
Key3=This and That value
[Section 2]
Key1=Section key
Another key=Here
; This section was created on the fly.
[New Section]
; This key did not previously exist.
New Key 1=Created key 1
; This key didn't exist either.
New Key 2=Created key 2
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net20 is compatible. net35 was computed. net40 was computed. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has 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.4.0.6028 | 1,706 | 6/2/2018 |
1.3.2.11206 | 1,211 | 6/11/2017 |