实例介绍
【实例简介】
国内知名的验证码识别程序,很高的验证码识别率
【实例截图】
【核心代码】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 | using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; using System.IO; namespace 联众打码实例 { public partial class Form1 : Form { ///命令功能:查询剩余验证码点数 ///strVcodeUser:联众账号 ///strVcodePass:联众密码 ///return string 成功返回->剩余验证码点数 [DllImport( "FastVerCode.dll" )] private static extern string GetUserInfo( string strVcodeUser, string strVcodePass); ///命令功能:通过作者的下线注册联众账号 ///strUser:注册用户 ///strPass:注册密码 ///strEmail:注册邮箱 ///strQQ:注册qq ///strAgentid:开发者软件id ///strAgentName:软件开发者账号id ///return int 1=成功;-1=网络传输异常;0=未知异常 [DllImport( "FastVerCode.dll" )] private static extern int Reglz( string strUser, string strPass, string strEmail, string strQQ, string strAgentid, string strAgentName); ///命令功能:通过上传验证码图片字节到服务器进行验证码识别,方便多线程发送 ///b:上传验证码图片字节集 ///len:上传验证码图片字节集长度 ///strVcodeUser:联众账号 ///strVcodePass:联众密码 ///成功返回->验证码结果|!|打码工人;后台没点数了返回:No Money! ;未注册返回:No Reg! ;上传验证码失败:Error:Put Fail! ;识别超时了:Error:TimeOut! ;上传无效验证码:Error:empty picture! [DllImport( "FastVerCode.dll" )] private static extern string RecByte( byte [] b, int len, string strVcodeUser, string strVcodePass); ///通过上传验证码图片字节到服务器进行验证码识别,方便多线程发送,这个函数可以保护作者的收入 ///b:上传验证码图片字节集 ///len:上传验证码图片字节集长度 ///strVcodeUser:联众账号 ///strVcodePass:联众密码 ///strAgentUser:软件开发者账号 ///成功返回->验证码结果|!|打码工人;后台没点数了返回:No Money! ;未注册返回:No Reg! ;上传验证码失败:Error:Put Fail! ;识别超时了:Error:TimeOut! ;上传无效验证码:Error:empty picture! [DllImport( "FastVerCode.dll" )] private static extern string RecByte_A( byte [] b, int len, string strVcodeUser, string strVcodePass, string strAgentUser); ///命令功能:通过发送验证码本地图片到服务器识别 ///strYZMPath:验证码本地路径,例如(c:\1.jpg) ///strVcodeUser:联众账号 ///strVcodePass:联众密码 ///成功返回->验证码结果|!|打码工人;后台没点数了返回:No Money! ;未注册返回:No Reg! ;上传验证码失败:Error:Put Fail! ;识别超时了:Error:TimeOut! ;上传无效验证码:Error:empty picture! [DllImport( "FastVerCode.dll" )] private static extern string RecYZM( string strYZMPath, string strVcodeUser, string strVcodePass); ///命令功能:通过发送验证码本地图片到服务器识别,这个函数可以保护作者的收入 ///strYZMPath:验证码本地路径,例如(c:\1.jpg) ///strVcodeUser:联众账号 ///strVcodePass:联众密码 ///strAgentUser:软件开发者账号 ///成功返回->验证码结果|!|打码工人;后台没点数了返回:No Money! ;未注册返回:No Reg! ;上传验证码失败:Error:Put Fail! ;识别超时了:Error:TimeOut! ;上传无效验证码:Error:empty picture! [DllImport( "FastVerCode.dll" )] private static extern string RecYZM_A( string strYZMPath, string strVcodeUser, string strVcodePass, string strAgentUser); ///命令功能:对打错的验证码进行报告。 ///strVcodeUser:联众用户 ///strDaMaWorker:打码工人 ///返回值类型:空 无返回值 [DllImport( "FastVerCode.dll" )] private static extern void ReportError( string strVcodeUser, string strDaMaWorker); public Form1() { InitializeComponent(); } private void Form1_Load( object sender, EventArgs e) { } private void button1_Click( object sender, EventArgs e) { if (textBox1.Text == "" && textBox2.Text == "" ) { MessageBox.Show( "填写联众账号或者密码" , "友情提示" ); } else { string returnMess = GetUserInfo(textBox1.Text, textBox2.Text); MessageBox.Show(returnMess, "友情提示" ); } } private void button3_Click( object sender, EventArgs e) { if (textBox3.Text == "" && textBox4.Text == "" ) { MessageBox.Show( "填写联众注册账号或者密码" , "友情提示" ); } else { int returnMess = Reglz(textBox3.Text, textBox4.Text, "" , "" , "" , "" ); if (returnMess == 1) { MessageBox.Show( "注册成功" , "友情提示" ); } else if (returnMess == 0) { MessageBox.Show( "未知异常" , "友情提示" ); } else if (returnMess == -1) { MessageBox.Show( "网络传输异常" , "友情提示" ); } else { MessageBox.Show( "注册失败" , "友情提示" ); } } } private void button4_Click( object sender, EventArgs e) { if (textBox1.Text == "" && textBox2.Text == "" ) { MessageBox.Show( "填写联众账号或者密码" , "友情提示" ); } else { MemoryStream ms = new MemoryStream(); Bitmap bmp = new Bitmap(pictureBox1.Image); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte [] photo_byte = new byte [ms.Length]; ms.Position = 0; ms.Read(photo_byte, 0, Convert.ToInt32(ms.Length)); bmp.Dispose(); System.Diagnostics.Debug.WriteLine(photo_byte.Length); string returnMess = RecByte(photo_byte, photo_byte.Length,textBox1.Text,textBox2.Text); if (returnMess.Equals( "No Money!" )) { MessageBox.Show( "点数不足" , "友情提示" ); } else if (returnMess.Equals( "No Reg!" )) { MessageBox.Show( "没有注册" , "友情提示" ); } else if (returnMess.Equals( "Error:Put Fail!" )) { MessageBox.Show( "上传验证码失败" , "友情提示" ); } else if (returnMess.Equals( "Error:TimeOut!" )){ MessageBox.Show( "识别超时" , "友情提示" ); } else if (returnMess.Equals( "Error:empty picture!" )){ MessageBox.Show( "上传无效验证码" , "友情提示" ); } else { textBox5.Text = returnMess.Split( '|' )[0]; textBox6.Text = returnMess.Split( '|' )[2]; MessageBox.Show( "识别成功" , "友情提示" ); } } } private void button5_Click( object sender, EventArgs e) { if (textBox1.Text == "" && textBox2.Text == "" ) { MessageBox.Show( "填写联众账号或者密码" , "友情提示" ); } else { MemoryStream ms = new MemoryStream(); Bitmap bmp = new Bitmap(pictureBox1.Image); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg); byte [] photo_byte = new byte [ms.Length]; ms.Position = 0; ms.Read(photo_byte, 0, Convert.ToInt32(ms.Length)); bmp.Dispose(); string returnMess = RecByte_A(photo_byte, photo_byte.Length, textBox1.Text, textBox2.Text, "" ); if (returnMess.Equals( "No Money!" )) { MessageBox.Show( "点数不足" , "友情提示" ); } else if (returnMess.Equals( "No Reg!" )) { MessageBox.Show( "没有注册" , "友情提示" ); } else if (returnMess.Equals( "Error:Put Fail!" )) { MessageBox.Show( "上传验证码失败" , "友情提示" ); } else if (returnMess.Equals( "Error:TimeOut!" )) { MessageBox.Show( "识别超时" , "友情提示" ); } else if (returnMess.Equals( "Error:empty picture!" )) { MessageBox.Show( "上传无效验证码" , "友情提示" ); } else { textBox5.Text = returnMess.Split( '|' )[0]; textBox6.Text = returnMess.Split( '|' )[2]; MessageBox.Show( "识别成功" , "友情提示" ); } } } private void button9_Click( object sender, EventArgs e) { OpenFileDialog openFileDlg = new OpenFileDialog(); openFileDlg.Title = "请选择图片验证码:" ; openFileDlg.Filter = "jpg|*.jpg|gif|*.gif|png|*.png" ; openFileDlg.ShowDialog(); if (openFileDlg.CheckFileExists) { textBox7.Text=openFileDlg.FileName; } else MessageBox.Show( "请选择有效的验证码图片!" ); } private void button10_Click( object sender, EventArgs e) { if (textBox1.Text == "" && textBox2.Text == "" ) { MessageBox.Show( "填写联众账号或者密码" , "友情提示" ); } else if (textBox7.Text == "" ) { MessageBox.Show( "" , "友情提示" ); } else { string returnMess = RecYZM(textBox7.Text, textBox1.Text, textBox2.Text); if (returnMess.Equals( "No Money!" )) { MessageBox.Show( "点数不足" , "友情提示" ); } else if (returnMess.Equals( "No Reg!" )) { MessageBox.Show( "没有注册" , "友情提示" ); } else if (returnMess.Equals( "Error:Put Fail!" )) { MessageBox.Show( "上传验证码失败" , "友情提示" ); } else if (returnMess.Equals( "Error:TimeOut!" )) { MessageBox.Show( "识别超时" , "友情提示" ); } else if (returnMess.Equals( "Error:empty picture!" )) { MessageBox.Show( "上传无效验证码" , "友情提示" ); } else { textBox5.Text = returnMess.Split( '|' )[0]; textBox6.Text = returnMess.Split( '|' )[2]; MessageBox.Show( "识别成功" , "友情提示" ); } } } private void button11_Click( object sender, EventArgs e) { if (textBox1.Text == "" && textBox2.Text == "" ) { MessageBox.Show( "填写联众账号或者密码" , "友情提示" ); } else if (textBox7.Text == "" ) { MessageBox.Show( "" , "友情提示" ); } else { string returnMess = RecYZM_A(textBox7.Text, textBox1.Text, textBox2.Text, "" ); if (returnMess.Equals( "No Money!" )) { MessageBox.Show( "点数不足" , "友情提示" ); } else if (returnMess.Equals( "No Reg!" )) { MessageBox.Show( "没有注册" , "友情提示" ); } else if (returnMess.Equals( "Error:Put Fail!" )) { MessageBox.Show( "上传验证码失败" , "友情提示" ); } else if (returnMess.Equals( "Error:TimeOut!" )) { MessageBox.Show( "识别超时" , "友情提示" ); } else if (returnMess.Equals( "Error:empty picture!" )) { MessageBox.Show( "上传无效验证码" , "友情提示" ); } else { textBox5.Text = returnMess.Split( '|' )[0]; textBox6.Text = returnMess.Split( '|' )[2]; MessageBox.Show( "识别成功" , "友情提示" ); } } } private void button6_Click( object sender, EventArgs e) { if (textBox1.Text == "" ) { MessageBox.Show( "请输入联众账号" , "友情提示" ); } else if (textBox6.Text == "" ) { MessageBox.Show( "请输入打码工人" , "友情提示" ); } else { ReportError(textBox1.Text, textBox6.Text); } } } } |
好例子网口号:伸出你的我的手 — 分享!
网友评论
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
支持(0) 盖楼(回复)