QTP图片验证码破解

Dim strURL
Systemutil.CloseProcessByName "iexplore.exe"
strURL="http://www.lietou.com/user/regc/regloginemail/"
Call MaximizeBrowser
SystemUtil.Run "IEXPLORE.EXE",strURL
wait 10
Browser("注册邮箱_职场精英注册_用户注册_猎聘猎头网:LieTou.").Page("注册邮箱_职场精英注册_用户注册_猎聘猎头网:LieTou.").Image("验证码,看不清楚?请点击刷新验证码").CaptureBitmap "e:\12.bmp",true
call yanzhm(data1)
msgbox data1




Public Function yanzhm (data)
Systemutil.Run"C:\test.bat"
Dim fso, myfile
Set fso=CreateObject("scripting.FileSystemObject")
Set myfile = fso.openTextFile("e:\2.txt",1,false)
tmp = split(myfile.readline,",")
data = tmp(0)
end Function




public Sub MaximizeBrowser
Set BrowserObject = Description.Create()
BrowserObject("NativeClass").Value = "IEFrame"
Set WindowsBrowser = Desktop.ChildObjects(BrowserObject)
brNum = WindowsBrowser.Count - 1
For i = 0 To brNum
ieVersion = WindowsBrowser(i).GetROProperty("version")
wndTitle = WindowsBrowser(i).GetROProperty("title")
Set ObjectBrowser = Browser("micclass:=Browser", "index:="&i)
If Instr(ieVersion,6) > 0 Then
Window("regexpwndclass:=IEFrame","index:=0","text:="&wndTitle&".*").M
aximize
Else
WindowsBrowser(i).Maximize
End If
Set ObjectBrowser = Nothing
Next
Set WindowsBrowser = Nothing
Set BrowserObject = Nothing

End Sub





































你可能感兴趣的:(验证码)