Passwort abfrage im Gui

  • Hallo leute ;)
    Die SuFu hat mir nix tolles gebracht mit dem Thema hier.
    Also ich wollte eine Passwort abfrage machen , aber NICHT mit Inputbox sonder im Gui !

    Spoiler anzeigen
    [autoit]

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 125, 51, 465, 383)
    $Button1 = GUICtrlCreateButton("Button1", 0, 24, 123, 25, 0)
    $Input1 = GUICtrlCreateInput("Input1", 0, 0, 121, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button1
    If $Input1 <> "alex" Then .....

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

    EndSwitch
    WEnd

    [/autoit]

    Und wenn das richtig ist soll das Richtige Gui mit den Ganzen Funktionen kommen ....Aber in dem Script ansich ;)

    Könnt ihr mir vll helfen ;)

    MfG <-- :P

    Einmal editiert, zuletzt von Teddy (3. September 2008 um 18:01)

  • Du musst einfach das $Input1 einlesen GuiCtrlread und dann kannst Du mit dem Wert von der Inputbox doch machen was du willst.. Ich versteh das Problem nicht ganz genau.

    [autoit]

    #include <GUIConstantsEx.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 125, 51, 465, 383)
    $Button1 = GUICtrlCreateButton("Button1", 0, 24, 123, 25, 0)
    $Input1 = GUICtrlCreateInput("Input1", 0, 0, 121, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    Case $Button1
    GuiCtrlread($Input1)
    If $Input1 "alex" Then .....
    EndSwitch
    WEnd

    [/autoit]

    ---
    In "Independence Day" konnten die Windows-Erdcomputer problemlos mit denen der Außerirdischen kommunizieren. Was sagt uns das über unseren lieben Bill Gates? :D
    ---

  • Also so wenn ich es richtig verstanden hab ( passwort ist alex )

    Spoiler anzeigen
    [autoit]

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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 173, 44, 443, 345)
    $Input1 = GUICtrlCreateInput("", 8, 8, 121, 21)
    $Button1 = GUICtrlCreateButton("OK", 136, 8, 27, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $jo = GUICtrlRead ( $input1 )
    Maingui()
    EndSwitch
    WEnd

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

    Func Maingui()
    If $jo = "alex" Then
    GUISetState(@SW_HIDE,$Form1)
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("Form1", 633, 447, 193, 125)
    $Label2 = GUICtrlCreateLabel("Hallo", 288, 200, 28, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit

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

    EndSwitch
    WEnd
    Else
    MsgBox ( 0, "Falsches Passwort", "Das Eingegebene Passwort ist falsch" )
    EndIf
    EndFunc

    [/autoit]