ok so sql lite version of this was easy, why now do i have to make an ini version ... because boss said so.
here it is.
I am using a simple ini class to read and write to inis
mostly no problem except one thing
I need to be able to read all keys from a section without knowing exactly how many there are and grab the every variable from every key.

below is class i'm using at moment because it is small and very litl overhead,
I dont need a major overhaul, just wondering if anyone might can add to what i have to do what i need.

for futher thought, grab section --> grab every key and it's variable --> use each variable in a loop
for instance say i store a bunch of exe paths to a bunch of keys (1-100) and i want to run a loop Process.Start(eachKey'sVariable) ... how?

Class Code:
  1. Public Class IniFile
  2.  
  3.     ' API functions
  4.     Private Declare Ansi Function GetPrivateProfileString _
  5.       Lib "kernel32.dll" Alias "GetPrivateProfileStringA" _
  6.       (ByVal lpApplicationName As String, _
  7.       ByVal lpKeyName As String, ByVal lpDefault As String, _
  8.       ByVal lpReturnedString As System.Text.StringBuilder, _
  9.       ByVal nSize As Integer, ByVal lpFileName As String) _
  10.       As Integer
  11.     Private Declare Ansi Function WritePrivateProfileString _
  12.       Lib "kernel32.dll" Alias "WritePrivateProfileStringA" _
  13.       (ByVal lpApplicationName As String, _
  14.       ByVal lpKeyName As String, ByVal lpString As String, _
  15.       ByVal lpFileName As String) As Integer
  16.     Private Declare Ansi Function GetPrivateProfileInt _
  17.       Lib "kernel32.dll" Alias "GetPrivateProfileIntA" _
  18.       (ByVal lpApplicationName As String, _
  19.       ByVal lpKeyName As String, ByVal nDefault As Integer, _
  20.       ByVal lpFileName As String) As Integer
  21.     Private Declare Ansi Function FlushPrivateProfileString _
  22.       Lib "kernel32.dll" Alias "WritePrivateProfileStringA" _
  23.       (ByVal lpApplicationName As Integer, _
  24.       ByVal lpKeyName As Integer, ByVal lpString As Integer, _
  25.       ByVal lpFileName As String) As Integer
  26.     Dim strFilename As String
  27.  
  28.     ' Constructor, accepting a filename
  29.     Public Sub New(ByVal Filename As String)
  30.         strFilename = Filename
  31.     End Sub
  32.  
  33.     ' Read-only filename property
  34.     ReadOnly Property FileName() As String
  35.         Get
  36.             Return strFilename
  37.         End Get
  38.     End Property
  39.  
  40.     Public Function GetString(ByVal Section As String, _
  41.       ByVal Key As String, ByVal [Default] As String) As String
  42.         ' Returns a string from your INI file
  43.         Dim intCharCount As Integer
  44.         Dim objResult As New System.Text.StringBuilder(256)
  45.         intCharCount = GetPrivateProfileString(Section, Key, _
  46.            [Default], objResult, objResult.Capacity, strFilename)
  47.         If intCharCount > 0 Then GetString = _
  48.            Left(objResult.ToString, intCharCount)
  49.     End Function
  50.  
  51.     Public Function GetInteger(ByVal Section As String, _
  52.       ByVal Key As String, ByVal [Default] As Integer) As Integer
  53.         ' Returns an integer from your INI file
  54.         Return GetPrivateProfileInt(Section, Key, _
  55.            [Default], strFilename)
  56.     End Function
  57.  
  58.     Public Function GetBoolean(ByVal Section As String, _
  59.       ByVal Key As String, ByVal [Default] As Boolean) As Boolean
  60.         ' Returns a boolean from your INI file
  61.         Return (GetPrivateProfileInt(Section, Key, _
  62.            CInt([Default]), strFilename) = 1)
  63.     End Function
  64.  
  65.     Public Sub WriteString(ByVal Section As String, _
  66.       ByVal Key As String, ByVal Value As String)
  67.         ' Writes a string to your INI file
  68.         WritePrivateProfileString(Section, Key, Value, strFilename)
  69.         Flush()
  70.     End Sub
  71.  
  72.     Public Sub WriteInteger(ByVal Section As String, _
  73.       ByVal Key As String, ByVal Value As Integer)
  74.         ' Writes an integer to your INI file
  75.         WriteString(Section, Key, CStr(Value))
  76.         Flush()
  77.     End Sub
  78.  
  79.     Public Sub WriteBoolean(ByVal Section As String, _
  80.       ByVal Key As String, ByVal Value As Boolean)
  81.         ' Writes a boolean to your INI file
  82.         WriteString(Section, Key, CStr(CInt(Value)))
  83.         Flush()
  84.     End Sub
  85.  
  86.     Private Sub Flush()
  87.         ' Stores all the cached changes to your INI file
  88.         FlushPrivateProfileString(0, 0, 0, strFilename)
  89.     End Sub
  90.  
  91. End Class