Unicode Controls & Classes for VB6 - Version 4

clsFileIniEx Class

This class permits you to manage Unicode .ini files encoded in UTF8, Unicode UTF16 and ANSI.
It is possible to use characters like spaces, ", etc... and you can avoid the use of sections.
It is possible to read files up to 50 MB (limited by code).

Enums
Name Description
Events
Name Description
Properties
Name Type Description
AllowTabs (Boolean) Gets or sets the ability to include spaces and tabs chars in the Values of rows
CommentChar (String) Gets or sets the value of the comment char
IniFile (String) Gets or sets the current .ini file
KeyValueSepChar (String) Gets or sets the character used for separating the key and the value
Methods
Name Type Description
AddBool Adds/Updates a row in the file
AddString Adds/Updates a row in the file
GetBool (Boolean) Gets a boolean from the loaded .ini file
GetSectionNames Gets an array containing the sections of the .ini file
GetSectionRowKey (String) Gets the key of a row obtained using the [GetSectionRows] function
GetSectionRows Gets an array containing the lines of the specified sections
GetSectionRowValue (String) Gets the valueof a row obtained using the [GetSectionRows] function
GetString (String) Gets a string from the loaded .ini file
Load (Boolean) Loads a certain .ini file into memory; returns True if the loading has finished correctly
LoadFromString (Boolean) Loads a certain string as a .ini file; returns True if the loading has finished correctly
RemoveRowKeyVal (Boolean) Removes a row from the file; returns True if the row has been removed
RemoveSection (Boolean) Removes the specified section from the file
Save (Boolean) Saves the .ini file
Remarks
After a change to the file you need to call the [Save] method to update the related file

Private Sub pvParseLicenseFile(sFile As String)
Dim oIni As clsFileIniEx
Set oIni = New clsFileIniEx

oIni.AllowTabs = False
oIni.CommentChar = "*****************"
oIni.KeyValueSepChar = ":"

Dim sRegName As String
Dim sRegEmail As String

If oIni.Load(sFile) Then
sRegName = oIni.GetString("", "regname")
sRegEmail = oIni.GetString("", "regemail")

If sRegName <> "" Then
txtRegName.Text = sRegName
End If
If sRegEmail <> "" Then
txtRegEmail.Text = sRegEmail
End If
Else
ShowError mls_GGS_Params("0013", "File '%1' not found.", sFile)
End If

End Sub