Allgemeine Probleme

  • [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit][autoit][/autoit][autoit]

    #Region ### START Koda GUI section ### Form=C:\Users\alex\Desktop\Login.kxf
    $Login = GUICreate("Login", 203, 124, 201, 125)
    GUISetBkColor(0x000000)
    $Input_1 = GUICtrlCreateInput("", 56, 56, 121, 21)
    $Input_2 = GUICtrlCreateInput("", 56, 24, 121, 21)
    $PW = GUICtrlCreateLabel("PW", 16, 56, 27, 22)
    GUICtrlSetFont(-1, 11, 400, 0, "DejaVu Serif Condensed")
    GUICtrlSetColor(-1, 0x3399FF)
    $ID = GUICtrlCreateLabel("ID", 16, 24, 20, 22)
    GUICtrlSetFont(-1, 11, 400, 0, "DejaVu Serif Condensed")
    GUICtrlSetColor(-1, 0x3399FF)
    $Save = GUICtrlCreateButton("Save", 56, 88, 83, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit][autoit][/autoit][autoit][/autoit][autoit][/autoit][autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg == $GUI_EVENT_CLOSE Then
    GUIDelete()
    ExitLoop
    EndIf
    ; Führe Aktionen aus beim Drücken auf "Save"
    If $msg == $Save Then
    ;Breche ab wenn das ID-Feld leer ist
    If GUICtrlRead($Input_2) == "" Then
    MsgBox( 64, "Achtung!", "Die ID wurde nicht eingetragen!")
    ContinueLoop
    EndIf
    ;Breche ab wenn das PW-Feld leer ist
    If GUICtrlRead($Input_1) == "" Then
    MsgBox( 64, "Achtung!", "Das PW wurde nicht eingetragen!")
    ContinueLoop
    EndIf
    ;Schreibe ID und PW in eine Ini-Datei
    iniWrite (@ScriptDir & "\" & "config.ini", "Config", "ID", GUICtrlRead($Input_2))
    iniWrite (@ScriptDir & "\" & "config.ini", "Config", "PW", GUICtrlRead($Input_1))
    GUIDelete()
    EndIf
    WEnd

    [/autoit]

    Ich will abfragen lassen, ob ID & PW schon in der config.ini stehen am besten mit IniRead
    Aber irgendwie weiß ich nicht so richtig wie
    ( natürlich sollte die GUI dann erst garnicht angezeigt werden, wenn die ID & PW schon drin steht )


    Vielen dank

    Ps: diesmal lass ich den thread so, raupi :)

  • Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=C:\Users\alex\Desktop\Login.kxf
    $Login = GUICreate("Login", 203, 124, 201, 125)
    GUISetBkColor(0x000000)
    $Input_1 = GUICtrlCreateInput("", 56, 56, 121, 21)
    $Input_2 = GUICtrlCreateInput("", 56, 24, 121, 21)
    $PW = GUICtrlCreateLabel("PW", 16, 56, 27, 22)
    GUICtrlSetFont(-1, 11, 400, 0, "DejaVu Serif Condensed")
    GUICtrlSetColor(-1, 0x3399FF)
    $ID = GUICtrlCreateLabel("ID", 16, 24, 20, 22)
    GUICtrlSetFont(-1, 11, 400, 0, "DejaVu Serif Condensed")
    GUICtrlSetColor(-1, 0x3399FF)
    $Save = GUICtrlCreateButton("Save", 56, 88, 83, 25, 0)

    [/autoit] [autoit][/autoit] [autoit]

    If FileExists(@ScriptDir&"\config.ini") Then
    If IniRead(@ScriptDir&"\config.ini", "Config", "ID", "NotFound") <> "NotFound" Then
    $readID = IniRead(@ScriptDir&"\config.ini", "Config", "ID", "NotFound")
    $readPW = IniRead(@ScriptDir&"\config.ini", "Config", "PW", "NotFound")
    MsgBox(0,"","ID und Passwort sind bereits vorhanden!")
    Exit
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]


    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    While 1
    $msg = GUIGetMsg()
    If $msg == $GUI_EVENT_CLOSE Then
    GUIDelete()
    ExitLoop
    EndIf
    ; Führe Aktionen aus beim Drücken auf "Save"
    If $msg == $Save Then
    ;Breche ab wenn das ID-Feld leer ist
    If GUICtrlRead($Input_2) == "" Then
    MsgBox( 64, "Achtung!", "Die ID wurde nicht eingetragen!")
    ContinueLoop
    EndIf
    ;Breche ab wenn das PW-Feld leer ist
    If GUICtrlRead($Input_1) == "" Then
    MsgBox( 64, "Achtung!", "Das PW wurde nicht eingetragen!")
    ContinueLoop
    EndIf
    ;Schreibe ID und PW in eine Ini-Datei
    iniWrite (@ScriptDir & "\" & "config.ini", "Config", "ID", GUICtrlRead($Input_2))
    iniWrite (@ScriptDir & "\" & "config.ini", "Config", "PW", GUICtrlRead($Input_1))
    GUIDelete()
    EndIf
    WEnd

    [/autoit]

    MfG Schnuffel

    "Sarkasmus ist die niedrigste Form des Witzes, aber die höchste Form der Intelligenz."
    Val McDermid

    über mich...

    ich habe meine Erfahrungen hauptsächlich gesammelt in (grobe Übersicht):

    - RibbonBar Automation
    - MySQL Nutzung
    - GUIs in vielerlei Ausprägung
    - Nutzung von Powershell / Batch in AutoIt
    - Windows Automatisierung

    außerhalb von AutoIt:

    - Sprachen: PS, Batch, php, html(5), javascript, (perl eingeschränkt), vbs
    - Powershell (AD, WPF inkl. Multi-Threading, ...)
    - Deployment-Automatisierung ohne SCCM
    - Office-Nutzung mit COM-Object (AutoIt, PowerShell)
    - ActiveDirectory und alles was damit zusammenhängt
    - Hyper-V Clustering (Converged / Hyper Converged)
    - Serverhardware (Konfiguration, Aufbau, Architektur, Betrieb)

    Lieblingsthema:

    günstige Automatisierung von Vorgängen, für die andere Firmen viel Geld nehmen

    more to come ...