InputBox Error

  • Hallo nochmal!
    Guckt mal:

    Spoiler anzeigen
    [autoit]


    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Einloggen", 311, 108, 192, 124)
    $Label1 = GUICtrlCreateLabel("Moderator/en:", 8, 16, 72, 17)
    $Label2 = GUICtrlCreateLabel("Passwort:", 8, 40, 50, 17)
    $Input1 = GUICtrlCreateInput("", 88, 16, 217, 21)
    $Input2 = GUICtrlCreateInput("", 88, 40, 217, 21)
    $Button1 = GUICtrlCreateButton("Einloggen", 224, 64, 81, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(0, 88, 310, 17)
    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
    _logon()
    EndSwitch
    WEnd

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

    Func _logon()
    If $Input1 <> "JoNi" Then
    GUICtrlSetData($Progress1, 50)
    Else
    MsgBox(16,"Fehler!","Benutzername falsch!")
    EndIf
    If $Input 2 <> "12345678" Then
    GUICtrlSetData($Progress1, 100)
    MsgBox(0,"","Eingeloggt!")
    Else
    MsgBox(16,"","Passwort falsch!")
    EndIf
    EndFunc

    [/autoit]

    Irgendwie sagt er Passwort richtig wenn ich es falsch eingebe, und das sagt er auch beim Benutzernamen...
    Was ist da falsch gelaufen?

    MfG button421

    Meine fertigen Projekte:
    VirtualCash
    Monopoly Digital

    Daran arbeite ich gerade:
    Einem Skript, womit man ohne Programmierkentisse eigene Programme machen kann (habe ich selber früher gesucht :D ) Stand: ||||||||||||||||||||||||| 6%

    Einmal editiert, zuletzt von button421 (21. April 2010 um 18:10)

    • Offizieller Beitrag

    So:

    Spoiler anzeigen
    [autoit]


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

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Einloggen", 311, 108, 192, 124)
    $Label1 = GUICtrlCreateLabel("Moderator/en:", 8, 16, 72, 17)
    $Label2 = GUICtrlCreateLabel("Passwort:", 8, 40, 50, 17)
    $Input1 = GUICtrlCreateInput("", 88, 16, 217, 21)
    $Input2 = GUICtrlCreateInput("", 88, 40, 217, 21)
    $Button1 = GUICtrlCreateButton("Einloggen", 224, 64, 81, 25, $WS_GROUP)
    $Progress1 = GUICtrlCreateProgress(0, 88, 310, 17)
    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
    _logon()
    EndSwitch
    WEnd

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

    Func _logon()
    If GUICtrlRead($Input1) = "JoNi" Then
    GUICtrlSetData($Progress1, 50)
    Else
    MsgBox(16,"Fehler!","Benutzername falsch!")
    EndIf
    If GUICtrlRead($Input2) = "12345678" Then
    GUICtrlSetData($Progress1, 100)
    MsgBox(0,"","Eingeloggt!")
    Else
    MsgBox(16,"","Passwort falsch!")
    EndIf
    EndFunc

    [/autoit]
  • Danke Oscar! Du bist echtn Profi in Sachen von AutoIT.
    Gutes Vorbild für mich...

    MfG button421

    Meine fertigen Projekte:
    VirtualCash
    Monopoly Digital

    Daran arbeite ich gerade:
    Einem Skript, womit man ohne Programmierkentisse eigene Programme machen kann (habe ich selber früher gesucht :D ) Stand: ||||||||||||||||||||||||| 6%

  • Irgendwie hab ich das gefühl das niveau dieser Sprache ist ganz schön niedrig wenn jetzt jemand schon Profi ist, wenn er GuictrlRead beherrscht. ;) :D
    (Nichts für Ungut Oscar du bist wirklich n Klasse Programmierer :thumbup: )

    mfg Ubuntu