gleem Posted June 12, 2006 Share Posted June 12, 2006 I am trying to create a login verication code in the beginning of my script. sofar the script works (kind of). I am running into a snag that when the user enters a wrong verifcation number then thet input box locks up... here is my code: ------ #include <GUIConstants.au3> $Verificationcode = ((@YEAR * @MON * @MDAY) + (@HOUR + @MIN + @SEC) * 32904) ; Create GUI Box. GUICreate("Login Verification", 350, 300) ; will create a dialog box that when displayed is centered ; GUISetFont (9, 400, 0, "Arial") GUICtrlCreateLabel ("Login Verification", 10, 10, 330, 250) ; GUISetFont (9, 800, 0, "Arial") GUICtrlCreateLabel ("Verifiation Code: " & $Verificationcode & "", 100, 150) ; GUISetFont (9, 400, 0, "Arial") GUICtrlCreateLabel ("Please Type in Verification Code:", 10, 190) ; Verify Passcode from User $UserInput = GUICtrlCreateInput ( "", 10, 210, 330, 20) ; Launch Button $launchbtn = GUICtrlCreateButton (" Launch ", 100, 250) ; Abort Button $abortbtn = GUICtrlCreateButton (" Abort ", 200, 250) GUISetState () ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit If $msg = $abortbtn Then Exit if $msg = $launchbtn then If $Verificationcode = GUICtrlRead($UserInput) Then ExitLoop Else ContinueLoop endif Endif Wend Msgbox(1, $Verificationcode, GUICtrlRead($UserInput)) Link to comment Share on other sites More sharing options...
w0uter Posted June 12, 2006 Share Posted June 12, 2006 what is the use of this ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
gleem Posted June 12, 2006 Author Share Posted June 12, 2006 (edited) the use of this is more like a safety lock so that the user doesnt run the main script by mistake Edited June 12, 2006 by gleem Link to comment Share on other sites More sharing options...
Skrip Posted June 12, 2006 Share Posted June 12, 2006 (edited) $p = "password";<PUT PASSWORD THERE! $bLoop = 1 While $bLoop = 1 $text = InputBox("Password", "Please type in the correct password...", "", "*") If @error = 1 Then Exit Else ; They clicked OK, but did they type the right thing? If $text <> $p Then MsgBox(4096, "Error", "Wrong password try again...") Else $bLoop = 0; Exit the loop - ExitLoop would have been an alternative too :) EndIf EndIf WEnd ; Print the success message MsgBox(4096, "Password", "Password Accepted") Edited June 12, 2006 by Firestorm [left][sub]We're trapped in the belly of this horrible machine.[/sub][sup]And the machine is bleeding to death...[/sup][sup][/sup][/left] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now