本帖最后由 nmgwddj 于 2010-2-27 13:06 编辑
如上图 如何打开红色圈里的网站
还有就是程序开始运行的时候 如何锁定网页中的输入框 输入相关数据
我现在是锁定程序窗口 然后SEND 不知道网页中输入框的控件是什么 该如何操作!
是在不知道怎么下手 不想用模拟鼠标点击啊; *******************************************************
; Example 1 - Trap COM errors so that 'Back' and 'Forward'
; outside of history bounds does not abort script
; (expect COM errors to be sent to the console)
; *******************************************************
;
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
_IEErrorHandlerRegister()
$oIE = _IECreateEmbedded()
GUICreate("测试", 640, 580, _
(@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
$WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 600, 360)
;$GUI_Button_Back = GUICtrlCreateButton("开始", 10, 420, 100, 30)
;$GUI_Button_Forward = GUICtrlCreateButton("测试", 120, 420, 100, 30)
$GUI_Button_Home = GUICtrlCreateButton("返回主页", 230, 420, 100, 30)
;$GUI_Button_Stop = GUICtrlCreateButton("停止", 340, 420, 100, 30)
GUISetState() ;Show GUI
_IENavigate($oIE, "http://www.woai310.com/index.htm?u=3496/")
; Waiting for user to close the window
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Home
_IENavigate($oIE, "http://www.woai310.com/index.htm?u=3496/")
xie()
;Case $msg = $GUI_Button_Back
;_IEAction($oIE, "back")
;Case $msg = $GUI_Button_Forward
;_IEAction($oIE, "forward")
;Case $msg = $GUI_Button_Stop
;_IEAction($oIE, "stop")
EndSelect
WEnd
GUIDelete()
Exit
Func xie()
$Val = Random(1, 500, 1)
$kahao = FileReadLine("keywords.txt", $Val)
WinWait("测试")
WinActivate("测试")
Send($kahao)
Send("{enter}")
Sleep(10000)
EndFunc ;==>xie
|