破解网页验证码的问题(手头分不多了,只能给100,请谅解)(100分)

  • 主题发起人 主题发起人 枝上柳绵
  • 开始时间 开始时间

枝上柳绵

Unregistered / Unconfirmed
GUEST, unregistred user!
img:=elem as IHTMLImgElement;
ce:=img as IHTMLControlElement;
cp.add(ce);
try

cp.execCommand('Copy',false,0);//偶尔出现这样的错误 "cannot open clipbroad "
try
MyHandle := Clipboard.GetAsHandle(cf_Bitmap);
bmpPtr := GlobalLock(MyHandle);
img1.Picture.LoadFromClipboardFormat(cf_BitMap,MyHandle,0);
Clipboard.Clear;
GlobalUnlock(MyHandle);
finally
Clipboard.Close;
end;
bmp:=(img1.Picture.Bitmap as TBitmap) ;
checkstr:=getCheckStr(bmp);
except
img1.Picture.LoadFromClipboardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);

checkstr :='';
end;

从网上找到这样的答案
When applications do operations on the clipboard they need to lock it (to prevent other applications using the clipboard at the same time). In your case, SuperMemo tried to paste the article at the time when clipboard was locked. The following might have caused the situation:

1.you are pasting a large or complex article that takes longer to copy (repeat the paste to succeed)
2.another application locked the clipboard (see which or wait)
3.an application locked the clipboard permanently while crushing (at worst, restart Windows)
Retrieved from "http://wiki.supermemo.org/index.php?title=Cannot_open_clipboard"

查到原因,但是还是不能解决问题,应当是clipbroad的问题,但是我尝试了很多次都没有解决问题,破解成功10,然后就有一次这样的错误,
个人感觉不会是网页的问题,可能是delphi的剪贴板的问题,应当是我的程序那一步没有做到,但是我找不到,呵呵
谢谢您的关注
 
不用显示IE 自己显示到TImage中 再直接提交
 
cxz9大侠,说的俺不是太明白

程序的作用是读取网页里的验证码图片,然后将之破解
从网页里读取图片(通过copy的方法读取到剪贴板上,然后再读取到timage里),上面的方法是最通用的方法
 
cp.execCommand('Copy',false,0);//偶尔出现这样的错误 "cannot open clipbroad "
前面加一行
Clipboard.Open;
to prevent other applications using the clipboard at the same time
 
加上Clipboard.Open;后
出现unsupported clipboard format 错误(貌似这个错误更难解决)
谢谢hanpengshan_00大侠的关注
 
后退
顶部