John117 Posted October 9, 2008 Posted October 9, 2008 (edited) CODE; ==================================================================================================== ================ ; Functions -Auto logon construction option one - Uses send key to avoid cookie failure - Works with hidden form names ; ==================================================================================================== ================ Func _LoginOption1() $URL = "http://www.facebook.com/" ; Define Signon Forwarding Website $ObjIE = ObjCreate("InternetExplorer.Application") ; Open Forwarding Website $hIE = _IEPropertyGet($ObjIE, "hwnd") ; Get the handle WinSetState($hIE, "", @SW_MAXIMIZE) ; Maximize it With $ObjIE ; Wait until Forwarding Website loads .Visible = True .Navigate ($URL) Do Sleep(50) Until .ReadyState = 4 EndWith With $ObjIE.document.forms (0) ; Set Form Objects on Forwarding Website .LoginName.value = "USERNAME" ; Set the Username .password.value = "PASSWORD" ; Set the Password Send("{Enter}") ; ".Sumbit" alternative for 'Cookies disabled error' EndWith EndFunc ;==>_LoginOption1 ; ==================================================================================================== ================ ; Functions -Auto logon construction option two - Multi Form ; ==================================================================================================== ================ Func _LoginOption2() $oIE = _IECreate("http://www.facebook.com/") ; Creates IE window $oForms1 = _IEFormGetObjByName($oIE, "menubar_login") ; Finds the "Form" ;$oForms2 = _IEFormGetObjByName($oIE, "passwordForm") ; Finds the "Form" $oNum1 = _IEFormElementGetObjByName($oForms1, "email") ; Finds the "Username" Field $oNum2 = _IEFormElementGetObjByName($oForms2, "password") ; Finds the "password" Field $Username = "USERNAME" ; Define the Username ;$Password = "PASSWWORD" ; Define the Password _IEFormElementSetValue($oNum1, $Username) ; Sets the Username number field ;_IEFormElementSetValue($oNum2, $Password) ; Sets the Password number field ;_IEFormSubmit($oForms2) ; Sumbit EndFunc ;==>_LoginOption2 Edited October 9, 2008 by Hatcheda
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