Looks Posted January 23, 2012 Share Posted January 23, 2012 expandcollapse popup; ---------------------------------------------------------------------------- ; ---------------------------------------------------------------------------- ; ; Author: ; Malu05 aka. Mads Hagbart Lund <mads@madx.dk> ; ; Script Function: ; Login Script ; ; Notes: ; ; ---------------------------------------------------------------------------- ; ---------------------------------------------------------------------------- ;;================================================================================ ;;INCLUDES ;;================================================================================ #include <INet.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> ;;================================================================================ ;;VARIABEL DEFINITION ;;================================================================================ $WebFileLoc = "http://www.madx.dk/files/login.php" ;Put the link to the login file here. ;;================================================================================ ;;GUI CREATION ;;================================================================================ $Login = GUICreate("Login",220,100) ; //Create the login window $User = GUICtrlCreateInput("Username",10,10) ; //Create the Username Input $Pass = GUICtrlCreateInput("Password",10,40,-1,-1,$ES_PASSWORD) ; //Create the Password Input $OKbutton = GUICtrlCreateButton("Login",110,70,100) ; //Create the Login Button $Exit = GUICtrlCreateButton("Exit",10,70,100) ; //Create the Exit Button GUISetState() ; //Display the GUI ;;================================================================================ ;;LOGIN LOOP ;;================================================================================ While 1 ; //Initialize loop $msg = GUIGetMsg() ; //Recive Input Select Case $msg = $GUI_EVENT_CLOSE or $msg = $Exit ; //If the Exit or Close button is clicked, close the app. MsgBox(0, "Terminate", "Adios") ; //Say goodbye Exit ; //Exit the Application Case $msg = $OKbutton ; //If the Login button is clicked goto the login function _login() EndSelect WEnd ;;================================================================================ ;;_login() ;;================================================================================ func _login() $UsernameInput = GUICtrlRead($User) ; //Get the username from the Input $PasswordInput = GUICtrlRead($Pass) ; //Get the password from the Input if $UsernameInput = "" or $PasswordInput = "" Then ; //Check if the user forgot to put in username and/or password_ MsgBox(0,"ERROR","Please Enter a Username and Password") ; -> Then Print this error Else $WEBdata = _INetGetSource($WebFileLoc &'?user=' & $UsernameInput & '&pass=' & $PasswordInput) ; //Get the data from the PHP file if $WEBdata = "02" Then ; //Check for Error outputs_ MsgBox(0,"Error","Unable to Login" & @lf & "Username and or Password was incorrect") ;->Display error output ElseIf $WEBdata ="0102" Then MsgBox(0,"Error","Unable to Login" & @lf & "Password was incorrect") ;->Display error output Else msgbox(0,"Welcome","Welcome" & @lf & "data = " & StringTrimRight($WEBdata,2)) ; //Login Sucessfull. Post data. EndIf EndIf EndFunc ;--> _login() url : file : http://www.autoitscript.com/forum/index.php?app=core&module=attach§ion=attach&attach_id=26120 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 23, 2012 Moderators Share Posted January 23, 2012 Looks, Welcome to the Autoit forum. Do you have a question about, or problem with, that code? We are not mindreaders - we need some information in order to help you. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Looks Posted January 23, 2012 Author Share Posted January 23, 2012 (edited) We would like to add a function to check the serial number. The login page. I do not understand a foreign language in most eng. I will try. Communication to the point as possible. Edited January 23, 2012 by Looks 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