C# Tesseract代码不工作?

C# Tesseract代码不工作?,c#,tesseract,C#,Tesseract,我用C#编写了这段代码。我添加了tessnet2引用,但它仍然不起作用。加载表单,但如果我添加了行tessnet2.Tesseract tessocr=new tessnet2.Tesseract() 在Form_加载事件中。如果将其删除,将显示console.writeline。我不明白发生了什么事,这里有我遗漏的东西吗 using System; using System.Collections.Generic; using System.ComponentModel; using Syst

我用C#编写了这段代码。我添加了
tessnet2
引用,但它仍然不起作用。加载表单,但如果我添加了行
tessnet2.Tesseract tessocr=new tessnet2.Tesseract()
在Form_加载事件中。如果将其删除,将显示console.writeline
。我不明白发生了什么事,这里有我遗漏的东西吗

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 tessnet2;
using System.Threading;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
        Ocr ocr = new Ocr();
        using (Bitmap bmp = new Bitmap(@"C:\Users\jc\Desktop\test2.png"))
        {
            Console.WriteLine("ASdsa");
            tessnet2.Tesseract tessocr = new tessnet2.Tesseract();
            //tessocr.Init(null, "eng", false);
            //tessocr.GetThresholdedImage(bmp, Rectangle.Empty).Save("c:\\temp\\" + Guid.NewGuid().ToString() + ".bmp");
            //// Tessdata directory must be in the directory than this exe
            //Console.WriteLine("Multithread version");
            //ocr.DoOCRMultiThred(bmp, "eng");
            //Console.WriteLine("Normal version");
            //ocr.DoOCRNormal(bmp, "eng");
        }
    }
}
public class Ocr
{ .... some codes here ....}
}

是的,我把它包括在项目参考中。它在项目的调试文件夹下,在Form1\u Load中添加一个try/catch。异常是什么?catch(exception ex){Console.WriteLine(“此处”);Console.WriteLine(ex)}输出窗口上没有显示任何内容。。它只加载表单,但不执行其代码