AdvancedHMI Software

General Category => Tips & Tricks => Topic started by: bachphi on January 11, 2020, 10:26:53 AM

Title: INI file parser
Post by: bachphi on January 11, 2020, 10:26:53 AM
I did not know that Archie already included a file-parser in AHMI, so I use Nuget to download a parser for ini file, Ini-Parser by Ricardo is what I chose. There are so many similar things in Nuget that makes it difficult to chose
which is the right package for what you need.

Anyway, it's easy to use

Code: [Select]
Imports IniParser
Imports IniParser.Model

    Dim parser = New FileIniDataParser()
    Dim parsedData As IniData = parser.ReadFile(".\Settings.ini")

...

Dim ZebraAddress As String = parsedData("Zebra")("Address")                'Section, KeyName