Пример #1
0
        private void button6_Click(object sender, EventArgs e)
        {
            int loop = Int32.Parse(textLoop.Text);

            while (loop > 0)
            {
                loop--;
                string strContent;
                byte[] tempParas = new byte[1024];
                if (ANNWrapper.OCRFile(Application.StartupPath + "\\" + textInputTIF.Text, tempParas))
                {
                    strContent          = System.Text.Encoding.GetEncoding("GB2312").GetString(tempParas, 0, tempParas.Length);
                    textOCRContent.Text = strContent.Substring(0, strContent.IndexOf("\0"));
                }
                else
                {
                    if (textTraingInputs.Lines.Length == 0)
                    {
                        textTraingInputs.AppendText("OCRFile: " + Application.StartupPath + "\\" + textInputTIF.Text + " Failure!");
                    }
                    else
                    {
                        textTraingInputs.AppendText("\r\nOCRFile: " + Application.StartupPath + "\\" + textInputTIF.Text + " Failure!");
                    }
                }
            }
        }