基本信息
源码名称:C#版 联众远程打码实例下载 很高的验证码识别率
源码大小:0.16M
文件格式:.rar
开发语言:C#
更新时间:2013-09-04
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍

国内知名的验证码识别程序,很高的验证码识别率

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);
            }
        }
    }
}