IniLib

    • Beta
      Hi,


      Ich habe die ganze Lib nochmal neu programmiert, da irgendwie alles nicht so zusammen gepasst hat.




      Methoden:

      Leider hat nicht alles aufs Bild gepasst.




      Funktionsweiße:
      Spoiler anzeigen

      VB.NET-Quellcode

      1. IniLib.File.FilePath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) & "\config.ini"
      2. IniLib.File.ClearExistingItemsOnLoad = True 'Beim laden einer neuen Ini, werden die manuell angefügen Items gelöscht, bei false, werden sie drangehängt
      3. IniLib.File.AddSection("Hauptknoten1") 'Sections [Hauptknoten1]
      4. IniLib.File.AddSection("Hauptknoten2")
      5. IniLib.File.AddSection("Hauptknoten3")
      6. IniLib.File.AddSectionItem(0, "Testsbüääööj", "100") 'Untergeordnete Items: 'AddSectionItem(Index des Hauptknotens, Bezeichnung, Wert)
      7. IniLib.File.AddSectionItem(0, "Fraqs", "1030")
      8. IniLib.File.AddSectionItem(1, "Ionie", "102340")
      9. IniLib.File.AddSectionItem(1, "Kama", "10eqw0")
      10. IniLib.File.AddSectionItem(1, "Bedo", "Default")
      11. IniLib.File.AddSectionItem(2, "Seven", "None")
      12. IniLib.File.AddSectionItem(2, "Inuv", "Accept")
      13. IniLib.File.AddComment(0, "Fraqs", "Deklariert ein neues Fragment") 'Kommentar, (Section Index, Bezeichner, Kommentar)
      14. IniLib.File.AddComment(2, "Seven", "Bezeichnet eine neue Zahl")
      15. IniLib.File.SaveToIni() 'Speichern
      16. IniLib.File.LoadFromIni() 'Laden


      Auslesen und Verändert einzelener Sections und deren Items:


      VB.NET-Quellcode

      1. MsgBox(IniLib.File.GetSectionItemValue(1, "Bedo")) 'Liefert den Wert zurück (Section Index, SectionItemName)
      2. MsgBox(IniLib.File.GetSectionByIndex(1)) 'Liefert den Sectionnamen zurück (SectionIndex)
      3. MsgBox(IniLib.File.GetSectionIndexByName("Hauptknoten3")) 'Liefert den Index der angegebenen Section zurück
      4. MsgBox(IniLib.File.GetSectionItemIndexByName(1, "Bedo")) 'Liefert den Index eines SectionItems zurück, (SectionIndex, Name)
      5. IniLib.File.EditSection(0, "Neuer Knoten1") 'Editiert den Sectionnamen (Index, NeuerName)
      6. IniLib.File.EditSectionItemValue(2, "Inuv", "Invalid") 'Editiert die Value eines SectionItems, (SectionIdex, Name, NewValue)
      7. For Each sinfo In IniLib.File.GetAllSectionItems(0) ' Liefert alle Sectionitems, einer Section zurück, (Section Index)
      8. Next
      9. For Each sinfo In IniLib.File.GetAllSections 'Liefert alle Sections zurück
      10. Next
      11. For Each sinfo In IniLib.File.GetAllContent 'Liefert den Output zurück, so wie es in der Ini datei stehen würde.
      12. Next










      Informationen

      - Entwickelt mit VS 2008
      - Framework 2.0
      - Dateigröße: 17KB


      Download:

      IniLib




      Grüße

      Dieser Beitrag wurde bereits 5 mal editiert, zuletzt von „ThuCommix“ ()