Extract INIFormat_dll.rar
Add INIFormat.dll to references
(Rightclick Project > Add references)
Create subs/functions to read/write/delete
Code:
Private Sub SaveAll() Handles Me.FormClosing
Dim INI As New INIFormat.UseINI 'access to INIFormat.dlls functions
INI.Path = My.Application.Info.DirectoryPath & "\settings.ini" 'defines path of .ini
My.Computer.FileSystem.DeleteFile("INI.Path", FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
INI.WriteValue("Settings", "Close", CheckBox1.Checked) 'Save the state of CheckBox1 (True or False)
INI.WriteValue("Settings", "Auto", RadioButton1.Checked) 'Save the state of RadioButton1 (True or False)
INI.WriteValue("Settings", "Process", TextBox1.Text) 'Save the process
INI.WriteValue("DLLs", "Count", ListBox1.Items.Count) 'Save the amount of DLLs
For Each DLL In ListBox1.Items
Dim counter As Integer
counter = counter + 1
INI.WriteValue("DLLs", counter, dlls4inj.Item(DLL)) 'Save path of each DLL
Next
End Sub
Code:
Private Sub ReadAll() Handles Me.Load
Dim INI As New INIFormat.UseINI 'access to INIFormat.dlls functions
INI.Path = My.Application.Info.DirectoryPath & "\settings.ini" 'defines path of .ini
CheckBox1.Checked = INI.ReadValue("Settings", "Close") 'Changes the state of CheckBox1 to the saved one
If INI.ReadValue("Settings", "Auto") = "False" Then
RadioButton2.Checked = True 'Manual Injection
Else
RadioButton1.Checked = True 'Auto Injection
End If
For i As Integer = 1 To INI.ReadValue("DLLs", "Count") Step 1
Dim FileName As String
Dim DLLPath As String = INI.ReadValue("DLLs", i)
FileName = DLLPath.Substring(DLLPath.LastIndexOf("\"))
FileName = FileName.Replace("\", "")
Try
dlls4inj.Add(FileName, DLLPath)
ListBox1.Items.Add(FileName)
Catch ex2 As Exception
End Try
Next
End Sub