-
Notifications
You must be signed in to change notification settings - Fork 2
/
InternetExpHandle.cs
70 lines (62 loc) · 2.23 KB
/
InternetExpHandle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WindowsFormsApp1.bank;
/**
* ie浏览器操作
*
*
*/
namespace WindowsFormsApp1
{
class InternetExpHandle
{
/**
* 批量识别
*/
public BillHtml getBillListHtml() {
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/main_new.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;
}
/**
* 单张票据识别
*/
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;
}
}
}