NIMBUZZ TOOLS FORUM-2016
Kєяλℓλ-ßυzZ ►☻◄ ƒøяυλ⁄(-2016

✽✽✽✽✽✽✽✽✽✽✽✽ нι gυєѕт ✽✽✽✽✽✽✽✽✽✽✽✽✽✽

♚♚♚♚ωєℓ¢σмє тσ ♚kєяαℓα♕ßυzz♚ zσηє♚♚♚♚

ρℓєαѕє яєgιѕтєя тσ gєт ƒυℓℓ α¢¢єѕѕ αη∂ ∂σωηℓσα∂ ѕтυƒƒ . σηℓү яεgιsтεяε∂ мεмвεя αℓℓσωε∂ vιεω sρεcιαℓ zσηε αη∂ ∂σωηℓσα∂ sтυғғ.

тнαηк уσυ

вαℓυ кяιsнηα !
Welcome to Keralabuzz Forum 2015
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account

Foto

How To Recognise Captcha In C# With OCR Testract Engine



  • Por favor, inicie sesión para responder

View previous topic View next topic Go down  Message [Page 1 of 1]

#1
Fuera de línea
on Sun Dec 27, 2015 7:19 am


avatar

KßZ ►☻◄ ƒøяυλ⁄(-мємвєя

KßZ ►☻◄ ƒøяυλ⁄(-мємвєя
1. Step Creat A form And Drop Down A pictureBox on Form And Two TextBox One For Captcha Image Url And Another For Captcha Recognise Answer
2. Step Fisrt Of all Add tessnet2_32.dll in Your Refrance Library With Project. 
3. Step Copy All Code  Below Than Paste It on Your Project.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using tessnet2;

namespace Captch_Recogniser
{
    public partial class Form1 : Form
    {
       public Form1()
        {
            InitializeComponent();
        }
      string session = string.Empty;
       Tesseract ocr = new Tesseract();


       private void loadcaptcha() // Add Fuction For Get Captcha Image and Reply In A textBox
        {
            try
            {
                session = string.Empty;
                Random r = new Random();
                for (int i = 0; i < 9; i++)
                {
                    session += "abcdefghijklmnopqrstuvwxyz"[r.Next(10)]; 
                }
                pictureBox1.ImageLocation = "http://siteAddress.com/captcha" + session;
                pictureBox1.Load();
                var image = new Bitmap(pictureBox1.Image);
                Tesseract ocr = new Tesseract();
                ocr.SetVariable("tessedit_char_whitelist", "abcdefghijklmnopqrstuvwxyz");// Here tessedit_char_whitelist Use For Recognise Only Alphabates wich is Followed by "...
" After Comma , //
                ocr.Init(@"C:\Users\Admin\Desktop\Captcha_Recognise\tessdata", "eng", false);   //Testract Engine Address wich is save in tessdata Folder Andd tessdata Folder must be add in Your Project Folder Without Rename It //
                var result = ocr.DoOCR(image, Rectangle.Empty);
                string ad = "";
                foreach (Word word in result)
                    ad += word.Text;
                txtcap.Text = ad;// txtcap.Text is Captcha Reply TextBox
                System.Threading.Thread.Sleep(2000);
               
            }
            catch { }
        }
  }


}







Download Link For tessdata Captcha Recognisation Engine :  https://www.mediafire.com/?4z21z4rs6ataf4n




Download tessnet2_32.dll From Here : https://www.mediafire.com/?9jcn1a2mkm5jwk6




For More Add Me At [You must be registered and logged in to see this link.]

View user profile

Message [Page 1 of 1]