php调用验证码识别库,“完美验证码识别"库调用

importwin.ui;/*DSG{{*/mainForm = win.form(text="验证码识别";right=434;bottom=140)

mainForm.add(

button={cls="button";text="内存识别";left=174;top=79;right=254;bottom=119;z=4};

button2={cls="button";text="文件识别";left=174;top=24;right=254;bottom=64;z=2};

edit={cls="edit";left=277;top=53;right=424;bottom=94;edge=1;font=LOGFONT(h=-16);multiline=1;z=3};

plus={cls="plus";left=43;top=46;right=146;bottom=98;notify=1;z=1}

)/*}}*/mainForm.plus.skin(

background = {

hover ="/res/images/btn-hover.png";

focus ="/res/images/btn-focus.jpg";

active ="/res/images/btn-active.png";

disabled ="/res/images/btn-disabled.png";

}

)importfsys;if( !io.exist("d:\wm") ){

fsys.createDir("d:\wm\.dll\");

string.save("d:\wm\.dll\WmCode.dll",string.load("\res\WmCode.dll") )

}vardownVeriCode=function(){

thread.invoke(function(mainForm){importinet.whttp;importthread;varwhttp = inet.whttp();varimg;varu="http://www.zheyibu.com/validate/getvalidatecode";do{

img = whttp.get(u);

}while(!img)

thread.set("img", img);

string.save("\veri.png",img);

whttp.close();

mainForm.plus.setBackground(img);

},mainForm

);

}vargetVeriCode=function(f){

thread.invoke(function(mainForm,f){importwmCode;importthread;varwm=wmCode();vardat=string.load("\res\卓聘网.dat");varid=wm.loadWmFromBuffer(dat,"123");if(!wm.setWmOption(6,80)){//设置模糊系数为80与识别库对应参数mainForm.msgbox("模糊系数设置失败!");return;

};if(f=="文件识别"){

mainForm.edit.text="文件识别:"+wm.getImageFromFile(io.fullpath("\veri.png"),6);

}else{varimg=thread.get("img");

mainForm.edit.text="内存识别:"+wm.getImageFromBuffer(img,8);

}

},mainForm,f

)

}

mainForm.plus.oncommand =function(id,event){

downVeriCode();

}

mainForm.button2.oncommand =function(id,event){

getVeriCode("文件识别");

}

mainForm.button.oncommand =function(id,event){

getVeriCode("内存识别");

}

downVeriCode();

mainForm.enableDpiScaling();

mainForm.show();returnwin.loopMessage();

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值