找回密码
 加入
搜索
查看: 32148|回复: 2

[IE类操作] 网站注册的验证码图片,采用新建IE可以复制,而内嵌IE则不能,求助

[复制链接]
发表于 2013-7-23 11:59:16 | 显示全部楼层 |阅读模式
比如,这样操作,则将验证码图片并复制到GUI界面:
#include <ClipBoard.au3>
#include <GUIConstants.au3>
#include <IE.au3>


GUICreate("",300,700)
GUISetState()
$pic=GUICtrlCreatePic("",5,600,100,50)
$oIE=_IECreate("http://m.dangdang.com/register_email.php?sid")

$oImg = _IEImgGetCollection ($oIE,1)
$oPic = $oIE.Document.body.createControlRange()
$oPic.Add($oImg)
$oPic.Select()
$oPic.execCommand("Copy")
$img = ClipGet()
GUICtrlSetImage($pic,$img)
While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd
而如果把IE内嵌在GUI里,却读不出来,求助哦,
内嵌IE的代码为:
#include <ClipBoard.au3>
#include <GUIConstants.au3>
#include <IE.au3>


GUICreate("",300,700)
GUISetState()
$oIE=_IECreateEmbedded()
GUICtrlCreateObj($oIE, 5, 5, 330, 550);嵌入式ie控件
$pic=GUICtrlCreatePic("",5,600,100,50)
_IENavigate($oIE, "http://m.dangdang.com/register_email.php?sid", 1);注册页面
$oImg = _IEImgGetCollection ($oIE,1)
$oPic = $oIE.Document.body.createControlRange()
$oPic.Add($oImg)
$oPic.Select()
$oPic.execCommand("Copy")
$img = ClipGet()

GUICtrlSetImage($pic,$img)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
        EndSwitch
WEnd
发表于 2013-7-23 16:08:55 | 显示全部楼层
用InetGet可以吗
;~ Func Pic1Click()
;~         Local $hDownload = InetGet("http://bbss.shangdu.com/Login/randomcode.jsp?", @TempDir & "\code.jpeg", 1, 1)
;~ Do
;~     Sleep(250)
;~ Until InetGetInfo($hDownload, 2) ; 检查完成的下载.
;~ Local $nBytes = InetGetInfo($hDownload, 0)
;~ InetClose($hDownload) ; 关闭句柄以释放资源.
;~ GUICtrlSetImage($Pic1,@TempDir & "\code.jpeg")

;~ EndFunc
发表于 2013-7-24 17:13:51 | 显示全部楼层
呵呵··这个是IE权限问题· 你把这个网站 添加到受信任站点就可以了··
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-4 07:09 , Processed in 0.075987 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表