|
1.我现在已内嵌了一个IE 。。。自动POST了一个表单提交(用户名,密码,验证码)。。 然后我查询我是否登陆成功。如果登陆成功那么怎么样吧我登陆成功的页面在内嵌IE显示?? 如果登陆不成功则给出提示兵重新刷新一次验证码。。。代码如下: (我现在用的是自动贴表单然后再提交。)自动POST我还不知道怎么弄。#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <INet.au3>
#Include <File.au3>
#include <IE.au3>
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiComboBox.au3>
#Region ### START Koda GUI section ### Form=
FileDelete("c:\123.jpg")
Dim $x = 0, $var,$x1=0,$s_URL="http://www.dxqf10086.com/default.aspx"
Local $oIE = ObjCreate("Shell.Explorer.2")
$Form1_1 = GUICreate("Version", 807, 701, 192, 125)
$Group3 = GUICtrlCreateGroup("manage", 0, 1, 673, 113)
$Label10 = GUICtrlCreateLabel("仅早8:30-18:00可以连接系统", 280, 88, 170, 14, $WS_BORDER)
$Pic1 = GUICtrlCreateInput("", 56, 74, 121, 32)
GUICtrlSetFont(-1, 18, 400, 0, "黑体")
$Label8 = GUICtrlCreateLabel("账号:", 24, 17, 31, 17)
$Label9 = GUICtrlCreateLabel("密码:", 24, 50, 31, 17)
$List1 = GUICtrlCreateInput("", 56, 9, 121, 21)
$List2 = GUICtrlCreateInput("", 56, 41, 121, 32)
GUICtrlSetFont(-1, 18, 400, 4, "黑体")
$Button8 = GUICtrlCreateButton("登陆系统", 180, 41, 57, 32)
GUICtrlCreateLabel(" 【数据获取中】",180, 83, 97, 20)
$List3 = GUICtrlCreatePic("", 180, 73, 97, 32);;;;;;;;;验证码获取框
Local $obj_IE = GUICtrlCreateObj($oIE, 1, 235, 1024, 600)
Local $EventObject = ObjEvent($oIE, "IEEvent_", "DWebBrowserEvents")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$oIE.navigate($s_URL, 0)
_IELoadWait ($oIE)
Sleep(500)
InetGet("http://www.dxqf10086.com/verifyimg.aspx","c:\123.jpg",1,16)
Sleep(500)
GUICtrlSetImage ($List3,"c:\123.jpg")
FileDelete("c:\123.jpg")
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button8
If GUICtrlRead($List1)<>"" And GUICtrlRead($List2)<>"" And GUICtrlRead($Pic1)<>"" Then
$User = _IEGetObjById($oIE,"txtUserName")
$User.value = GUICtrlRead($List1)
$PW = _IEGetObjById($oIE,"TxtUserPass")
$PW.value = GUICtrlRead($List2)
$var = _IEGetObjById($oIE,"TxtVCode")
$var.value = GUICtrlRead($Pic1)
$Check = _IEGetObjById($oIE,"ImageButton1")
$Check.click
;WinMove($Version,"",Default,0,1024,830)
;MsgBox(0,0,_INetGetSource($oIE))
Sleep(3000)
InetGet("http://www.dxqf10086.com/verifyimg.aspx","c:\123.jpg")
Sleep(500)
GUICtrlSetImage ($List3,"c:\123.jpg")
FileDelete("c:\123.jpg")
Else
MsgBox(64,"提醒:","请检查您的账号密码或验证码是否正确!")
EndIf
EndSwitch
WEnd
2.如果检测网站是否开通。如果网站关闭或网络部通的时候。如何去检测。。_IELoadWait ($oIE)
时您的程序会出现假死现象。非常的卡。 能否有办法进行快速检测一下? |
评分
-
查看全部评分
|