Autoit Help Excel
Autoit Help Excel
From the AutoIt help file you should see this functions which are part of the Excel UDF:
_Excel_RangeRead()
And also if you are going to login to a website you need to look in to IE UDF
Examples and everything is on the help file.
After you try something and you got a problem you can publish here your problem and your code and we will help you.
Regards
Alien.
https://www.autoitscript.com/forum/topic/97418-simple-login-username-and-password/
My Script :
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>;
#include <EditConstants.au3>
While 1
$MSG = GUIGetMsg()
Switch $MSG
Case $ButtonOk
If VerifyLogin(GUICtrlRead($USERNAME),GUICtrlRead($PASSWORD)) = 1 Then
GUIDelete($Form1)
MsgBox(-1,"Logado com Sucesso","Login Succ..")
RunP()
Else
MsgBox(-1,"Error"," Username ou Senha está incorreto, Tente denovo")
EndIf
Case -3
Exit
Case $ButtonCancel
Exit
EndSwitch
WEnd
Func VerifyLogin($USERNAME,$PASSWORD)
If $USERNAME = "your user here" And $PASSWORD = "your pass here" Then
Return 1
Else
Return 0
EndIf
EndFunc; End login
Func Runp()
Func onautoitexit()
Exit
EndFunc ;==>onautoitexit
Exemple:
http://yoursite.com/login.txt
File .txt
usuario|pass1
usuario2|pass2
Func VerifyLogin($USERNAME,$PASSWORD)
local $x = 1
Do
inetget("http://yoursite.com/login.txt",@systemdir & "/login.txt")
$login = filereadline(@systemdir & "/login.txt",$x)
$string = stringsplit($login,"|")
if $string[1] = $username and $string[2] = $password then
return 1
exitloop
Else
$x = $x + 1
Endif
if $login = "" then
return 0
exitloop
endif
until $x = $x + 1
EndFunc