Sign in to follow this  
Followers 0
John117

Help with Auto Logon in IE

1 post in this topic

#1 ·  Posted (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 by Hatcheda

Share this post


Link to post
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
Sign in to follow this  
Followers 0