wie mache ich dass wenn ich wiederh. drück das fenster sich "Wiederholt."

  • also habe ein pw generator geschreiben,nun möchte ich dass wenn eine zahl generiert habe ein fenster kommt mit wiederholen und abbrechen (bis hier hin hab ichs ya).
    wenn ich auf wiederholen klick soll ein neues pw generiert werden,wen ich auf abbrechen klicke soll sich die Msgbox schliesen

    [autoit]


    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $gui = GUICreate("Passwort Creator", 600, 250, 300, 25)
    $1 = GUICtrlCreateButton("3 Stelliges Kennwort", 8, 8, 120, 25, $WS_GROUP)
    $2 = GUICtrlCreateButton("4 Stelliges Kennwort", 140, 8, 120, 25, $WS_GROUP)
    $3 = GUICtrlCreateButton("5 Stelliges Kennwort", 268, 8, 120, 25, $WS_GROUP)
    $4 = GUICtrlCreateButton("6 Stelliges Kennwort", 400, 8, 120, 25, $WS_GROUP)
    $5 = GUICtrlCreateButton("Zufällige Zahl generieren",8, 50, 200, 25, $WS_GROUP)
    $6 = GUICtrlCreateButton("Züfälliges Datum generieren", 250, 50, 200, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

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

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

    Case $1
    MsgBox(5,"Zahl","Dein Kennwort lautet: " & Random( 100, 999, 1))

    If $1 = 4 Then ; & Random( 100, 999, 1)
    EndIf

    Case $2
    MsgBox(5,"Zahl","Dein Kennwort lautet: " & Random( 1000, 9999, 1))
    Case $3
    MsgBox(5,"Zahl","Dein Kennwort lautet: " & Random( 10000, 99999, 1))
    Case $4
    MsgBox(5,"Zahl","Dein Kennwort lautet: " & Random( 100000, 999999, 1))
    Case $5
    MsgBox(5,"Dein Passwort","Deine Zufällige Zahl: " & Random(0,999999,1))
    Case $6
    MsgBox("5","Dein Datum","Dein Zufälliges Datum: " & Random (1,30,1)& Random(0,0,1)& Random (1,9,1)& Random (2010,2011,1))
    EndSwitch
    WEnd

    [/autoit][autoit][/autoit][autoit][/autoit]
  • Das lässt sich zwar noch effizienter gestalten, aber so hast du dir das vorgestellt oder?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $gui = GUICreate("Passwort Creator", 600, 250, 300, 25)
    $1 = GUICtrlCreateButton("3 Stelliges Kennwort", 8, 8, 120, 25, $WS_GROUP)
    $2 = GUICtrlCreateButton("4 Stelliges Kennwort", 140, 8, 120, 25, $WS_GROUP)
    $3 = GUICtrlCreateButton("5 Stelliges Kennwort", 268, 8, 120, 25, $WS_GROUP)
    $4 = GUICtrlCreateButton("6 Stelliges Kennwort", 400, 8, 120, 25, $WS_GROUP)
    $5 = GUICtrlCreateButton("Zufällige Zahl generieren", 8, 50, 200, 25, $WS_GROUP)
    $6 = GUICtrlCreateButton("Züfälliges Datum generieren", 250, 50, 200, 25, $WS_GROUP)
    GUISetState(@SW_SHOW)

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

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

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

    Case $1
    Do
    $Msg = MsgBox(5, "Zahl", "Dein Kennwort lautet: " & Random(100, 999, 1))
    Until $Msg = 2
    Case $2
    Do
    $Msg = MsgBox(5, "Zahl", "Dein Kennwort lautet: " & Random(1000, 9999, 1))
    Until $Msg = 2
    Case $3
    Do
    $Msg = MsgBox(5, "Zahl", "Dein Kennwort lautet: " & Random(10000, 99999, 1))
    Until $Msg = 2
    Case $4
    Do
    $Msg = MsgBox(5, "Zahl", "Dein Kennwort lautet: " & Random(100000, 999999, 1))
    Until $Msg = 2
    Case $5
    Do
    $Msg = MsgBox(5, "Dein Passwort", "Deine Zufällige Zahl: " & Random(0, 999999, 1))
    Until $Msg = 2
    Case $6
    Do
    $Msg = MsgBox("5", "Dein Datum", "Dein Zufälliges Datum: " & Random(1, 30, 1) & Random(0, 0, 1) & Random(1, 9, 1) & Random(2010, 2011, 1))
    Until $Msg = 2
    EndSwitch
    WEnd

    [/autoit]
  • 1 Thema hätte gereicht!
    man kann 1000000000000000000000000000000000000000000000000000000000000000 fragen in einem Thema stellenund du machst gleich 2!
    (ok das war hart!)
    sonst kann ich name22 nur zustimmen!
    so wirds gemacht!

    Edit BugFix: Alles Nötige gesagt. [CLOSED]

    Einmal editiert, zuletzt von BugFix (24. April 2010 um 22:39)