回复 10# andyto202
試看看
#include <IE.au3>
$Form1 = GUICreate("Form1", 225, 277,Default,Default,-1)
GUISetState(@SW_SHOW)
While 1
$nMsg = GUIGetMsg()
Sleep(10)
$oIE = _IEAttach ("http://localhost/member/login.php","URL")
IF @Error=0 Then
_Lgoin()
EndIf
Switch $nMsg
Case -3
Exit
EndSwitch
WEnd
Func _Lgoin()
Local $oUser, $oPass, $oSubmit
Local $sUser = "user"
Local $sPass = "pass"
Local $url = "http://localhost/member/login.php"
;Local $oIE = _IECreate($url, 1)
_IELoadWait($oIE)
$oInputs = _IETagNameGetCollection($oIE, "input")
for $oInput in $oInputs
if $oInput.type = "text" And $oInput.name = "username" Then $oUser = $oInput
if $oInput.type = "password" And $oInput.name = "password" Then $oPass = $oInput
if $oInput.type = "submit" And $oInput.value = "確定" Then $oSubmit = $oInput
if isObj($oUser) And isObj($oPass) And isObj($oSubmit) then exitloop
Next
$oUser.value = $sUser
$oPass.value = $sPass
_IEAction($oSubmit, "click")
_IELoadWait($oIE)
EndFunc
|