Jump to content

Login attempts.. value subtraction


SONICX
 Share

Recommended Posts

Hey guys.

I tried to make an simple-login program in AutoIT. But i have a small problem. Because I don't know how can I make 3 login attempts. If the user reach this, this program is Exit..

Any idea?

Thanks!:)

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <TrayConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 295, 108, 251, 166)
$Button1 = GUICtrlCreateButton("Login", 16, 72, 91, 25)
$Button2 = GUICtrlCreateButton("Exit", 168, 72, 91, 25)
$Label1 = GUICtrlCreateLabel("Password:", 8, 24, 54, 17)
$Input1 = GUICtrlCreateInput("", 72, 24, 201, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Global $szamlalo = 3;
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button2
            Exit
         Case $Button1
             $jelszo = GUICtrlRead($Input1)
             If $jelszo = "asd" Then
                MsgBox(0,"","Logged in!")
             ElseIf $jelszo == GUICtrlRead($Input1) Then
               ; how can i subtraction from $szamlalo value?
                TrayTip("Error!", "Incorrect data. Attempts: " & $szamlalo, 0,$TIP_ICONHAND)
             EndIf


    EndSwitch
WEnd

 

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