#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <IE.au3>
#include <Debug.au3>
$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("IE", 400, 300, -1, -1)
$GUIActiveX = GUICtrlCreateObj($oIE, -1, -1, 300, 300)
$oIE.navigate("http://weifang.1k100.com/")
$Input1 = GUICtrlCreateInput("用户名", 300, 10, 100, 20)
$Input2 = GUICtrlCreateInput("密码", 300, 50, 100,20)
$Button1 = GUICtrlCreateButton("点击登录", 300, 80, 100, 30)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg =$Button1
MsgBox(0,"提示","登录成功!")
EndSelect
WEnd
Exit
;~ $UserName = _IEGetObjById ($oIE, "LoginName")
;~ $UserName.value = "123456789012345678"
;~ $PassWord = _IEGetObjById ($oIE, "Password")
;~ $PassWord.value = "1111111"
;~ $Submit = _IEGetObjById ($oIE, "loginbtn")
;~ $Submit.submit
上面的是大致的代码,请各位指点一下,如何将GUI文本框内容填入内嵌IE,并判断是否成功登录,登录成功后返回成功,失败时显示错误,谢谢。 |