Sign in to follow this  
Followers 0
realkiller

login

2 posts in this topic

i made this script to login into a intern webpage

$oIE = _IECreate ("http://scaprd.upc.biz/sdchealtop")
$o_form = _IEFormGetObjByName ($oIE, "formlogin")
$o_login = _IEFormElementGetObjByName ($o_form, "login")
$o_password = _IEFormElementGetObjByName ($o_form, "password")
$o_signin = _IEFormElementGetObjByName ($o_form, "sublogin")

; Set field values and submit the form
_IEFormElementSetValue ($o_login, $SupportCenterusername)
_IEFormElementSetValue ($o_password, $SupportCenterPassword)
_IEAction ($o_signin, "click")
WinWaitActive("SupportSoft Support Center Web")
WinMove("SupportSoft Support Center Web", "", 0, 36, 956, 829)
GUICtrlSetImage($Pic3,@ScriptDir & "\Blauw.gif")
EndIfoÝ÷ ÚØ^¢yr¦ºé¢¶­iû^­¬!W²¢èZ½ëh"¨x­®'jëh×6Winactivate("support soft login")
$o_form = _IEFormGetObjByName ($oIE, "formlogin")
$o_login = _IEFormElementGetObjByName ($o_form, "login")
$o_password = _IEFormElementGetObjByName ($o_form, "password")
$o_signin = _IEFormElementGetObjByName ($o_form, "sublogin")

; Set field values and submit the form
_IEFormElementSetValue ($o_login, $SupportCenterusername)
_IEFormElementSetValue ($o_password, $SupportCenterPassword)
_IEAction ($o_signin, "click")

but then i get a error.

Share this post


Link to post
Share on other sites



I would try something like this.

#include <IE.au3>

$SupportCenterusername = "Username"
$SupportCenterPassword = "Password"

$sURL = "http://scaprd.upc.biz/sdchealtop"
$oIE = _IECreate($sURL)

While 1
    If Not _IsLoggedIn($oIE) Then _Login($oIE, $SupportCenterusername, $SupportCenterPassword)
    Sleep(500)
WEnd

Func _Login($o_object, $s_username, $s_password)
    
    $o_form = _IEFormGetObjByName($o_object, "formlogin")
    $o_login = _IEFormElementGetObjByName($o_form, "login")
    $o_password = _IEFormElementGetObjByName($o_form, "password")
    $o_signin = _IEFormElementGetObjByName($o_form, "sublogin")

    ; Set field values and submit the form
    _IEFormElementSetValue($o_login, $s_username)
    _IEFormElementSetValue($o_password, $s_password)
    _IEAction($o_signin, "click")
    _IELoadWait($o_object)
EndFunc   ;==>_Login

Func _IsLoggedIn($o_object)
    If _IEFormGetObjByName($o_object, "formlogin") == 0 Then
        Return 1
    Else
        Return 0
    EndIf
EndFunc   ;==>_IsLoggedIn

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