Пример #1
0
 private void button2_Click(object sender, EventArgs e)
 {
     //识别批量票据
     InternetExpHandle internetExpHandle = new InternetExpHandle();
     BillHtml          billHtml          = internetExpHandle.getBillListHtml();
     //List<BillSimple> billSimples = billHtml.GetBankContent.listBillSimple(billHtml.HtmlBody);
 }
Пример #2
0
        /**
         * 单张票据识别
         */
        public BillHtml getBillInfoHtml()
        {
            BillHtml billHtml = new BillHtml();

            SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindowsClass();
            foreach (SHDocVw.InternetExplorer ie in shellWindows)
            {
                string url = ie.LocationURL;
                if (url.Contains("https://ent.cmbc.com.cn:8443/eweb/static/commonPage/DraftDetail.html"))  //民生银行
                {
                    billHtml.GetBankContent = new BankContentCmbc();
                }

                if (billHtml.GetBankContent != null)
                {
                    mshtml.IHTMLDocument2 htmlDoc = (mshtml.IHTMLDocument2)ie.Document;
                    string aa = htmlDoc != null?htmlDoc.body.outerHTML.ToString() : "***Failed***";

                    billHtml.HtmlBody = aa;
                    break;
                }
            }

            return(billHtml);
        }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            //识别单张票据
            InternetExpHandle internetExpHandle = new InternetExpHandle();
            BillHtml          billHtml          = internetExpHandle.getBillInfoHtml();

            if (billHtml.GetBankContent == null)
            {
                this.textBox1.Text = "未获取到票据信息";
                return;
            }


            BillInfo billInfo = billHtml.GetBankContent.getBillInfo(billHtml.HtmlBody);

            if (billInfo != null)
            {
                this.textBox1.Text = billInfo.BillNo;
                this.textBox3.Text = billInfo.DueDt;
                this.textBox4.Text = billInfo.BillMoney;
                this.textBox5.Text = billInfo.Acceptor;
                this.textBox6.Text = billInfo.Remitter;
                this.textBox7.Text = billInfo.SueDt;
            }
            else
            {
                this.textBox1.Text = "未获取到票据信息";
            }
        }