Wenn man schnell mal etwas in eine INI eintragen möchte.
AutoIt
; IniWrite ( "filename", "section", "key", "value" )
#include <GuiConstants.au3>
;#Include <GuiCombo.au3>
GuiCreate("INI Eintragen", 380, 230,-1, -1 );, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))
GUISetBkColor(0x87ceeb) ; Hintergrundfarbe
; Gruppe
$font="Arial"
$Group_1 = GuiCtrlCreateGroup("INI Ersteller / Hinzufüger", 10, 10, 360, 210)
GUICtrlSetFont (-1,9, 400, $font)
; Sektion
$name = GuiCtrlCreateInput("bsp.ini", 100, 30, 255, 25)
$font="Arial"
$Label_2 = GuiCtrlCreateLabel("Dateiname", 20, 35, 80, 25)
GUICtrlSetFont (-1,9, 400, $font)
; Sektion
$sekt = GuiCtrlCreateInput("Sektion", 100, 65, 255, 25)
$font="Arial"
$Label_2 = GuiCtrlCreateLabel("Sektion", 20, 70, 80, 25)
GUICtrlSetFont (-1,9, 400, $font)
; Key
$key = GuiCtrlCreateInput("Key", 100, 100, 255, 20)
$font="Arial"
$Label_3 = GuiCtrlCreateLabel("Key", 20, 105, 80, 25)
GUICtrlSetFont (-1,9, 400, $font)
; Value
$value = GuiCtrlCreateInput("value", 100, 135, 255, 25)
$font="Arial"
$Label_4 = GUICtrlCreateLabel("Value", 20, 140, 80, 25)
GUICtrlSetFont (-1,9, 400, $font)
; Exit
$Button_1 = GuiCtrlCreateButton("Exit", 260, 165, 100, 40)
GUICtrlSetFont (-1,9, 400, $font)
; Eintragen in Registry
$Button_2 = GuiCtrlCreateButton("Eintragen", 20, 170, 100, 40)
GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $Button_2
Dim $dlg_answer
$dlg_answer = MsgBox(266529,"Soll INI-Datei erstellt werden?", GuiCtrlRead($name) &@LF& "[" & GuiCtrlRead($sekt) & "]" &@LF& GuiCtrlRead($key) & "=" & GuiCtrlRead($value))
if $dlg_answer = 1 then ;ok
$success = IniWrite(GuiCtrlRead($name) , GuiCtrlRead($sekt) , GuiCtrlRead($key) , GuiCtrlRead($value))
if $success <> 1 Then
msgbox(0,"Ein Fehler ist aufgetreten.","Bitte folgenden Fehlercode in der Hilfe nachlesen:" &@error)
Endif
Endif
Case $msg = $Button_1
Exit
Case Else
EndSelect
WEnd
Exit
Alles anzeigen
Anderer Thementitel viel mir nicht ein. Darf gerne durch von Mod's oder Admin's geämdert werden.