Jump to content

Login Verifcation to Script


Recommended Posts

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

$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 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...