|
本帖最后由 jingygr 于 2012-7-9 13:01 编辑 #include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <array.au3>
_IEErrorHandlerRegister ()
$oIE = _IECreateEmbedded ()
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", @DesktopWidth-50,@DesktopHeight-70,20,20)
$starButton = GUICtrlCreateButton("开始", 8, 8, 81, 33)
$stopButton = GUICtrlCreateButton("停止", 96, 8, 81, 33)
$sta = GUICtrlCreateLabel("Label1", 184, 16, 820, 17)
;$Group1 = GUICtrlCreateGroup("Group1", 8, 48, 1233, 665)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$GUIActiveX = GUICtrlCreateObj($oIE, 8, 48,@DesktopWidth-70,@DesktopHeight-120)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_IENavigate ($oIE, "http://mail.163.com")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $starButton
GUICtrlSetData($sta,"正在输入用户名")
$username=_IEGetObjByName($oIE,"username")
$username.value="citylaji"
Sleep(500)
GUICtrlSetData($sta,"正在输入密码")
$password=_IEGetObjByName($oIE,"password")
$password.value="531jingygr"
Sleep(500)
GUICtrlSetData($sta,"正在点击登录按钮")
$tijiao=_IEGetObjById($oIE,"loginBtn")
$tijiao.click
Sleep(500)
GUICtrlSetData($sta,"进入网易电子邮箱")
$oIE = _IEAttach ("网易电子邮箱", "embedded")
_IELoadWait($oIE)
GUICtrlSetData($sta,"进入网易电子邮箱,稍等3秒钟")
Sleep(1000)
GUICtrlSetData($sta,"进入网易电子邮箱,稍等2秒钟")
Sleep(1000)
GUICtrlSetData($sta,"进入网易电子邮箱,稍等1秒钟")
Sleep(1000)
GUICtrlSetData($sta,"点击“退出”链接")
MsgBox(0, "The URL", _IEPropertyGet ($oIE, "locationurl"))
_IELinkClickByText($oIE,"退出")
Case $stopButton
EndSwitch
WEnd
请问一下
请问一下,$oIE = _IECreate ("http://mail.163.com/",1,1)
打开网页后,用程序点击了网页中的一个窗口,并在原窗口中打开
请问一下新打开的网页还是在$oIE中吗?
为什么,我下面的那个_ArrayDisplay($ay)和_IELinkClickByText($oIE,"写信")
会无效 |
|