真是奇怪啊,当执行这个函数时直接跳到下面那个位置执行... public void GetRegCodePic(System.Windows.Forms.WebBrowser webBrowerObj, string ImgName)
{
HTMLDocument doc = (HTMLDocument)webBrowerObj.Document.DomDocument;
HTMLBody body = (HTMLBody)doc.body;
IHTMLControlRange rang = (IHTMLControlRange)body.createControlRange();
if (webBrowerObj.Document.GetElementById(ImgName) == null || webBrowser1.Url.ToString().IndexOf("www.tenpay.com/v2") < 0) return;
IHTMLControlElement Img;
Img = (IHTMLControlElement)webBrowerObj.Document.GetElementById(ImgName).DomElement;
rang.add(Img);
rang.execCommand("Copy", false, null); //直接跳到这里执行了
Bitmap bmp = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
if (Clipboard.ContainsData(DataFormats.Bitmap))
{
picR.Image = (Image)Clipboard.GetData(DataFormats.Bitmap);
}
Clipboard.Clear();
}
{
HTMLDocument doc = (HTMLDocument)webBrowerObj.Document.DomDocument;
HTMLBody body = (HTMLBody)doc.body;
IHTMLControlRange rang = (IHTMLControlRange)body.createControlRange();
if (webBrowerObj.Document.GetElementById(ImgName) == null || webBrowser1.Url.ToString().IndexOf("www.tenpay.com/v2") < 0) return;
IHTMLControlElement Img;
Img = (IHTMLControlElement)webBrowerObj.Document.GetElementById(ImgName).DomElement;
rang.add(Img);
rang.execCommand("Copy", false, null); //直接跳到这里执行了
Bitmap bmp = (Bitmap)Clipboard.GetDataObject().GetData(DataFormats.Bitmap);
if (Clipboard.ContainsData(DataFormats.Bitmap))
{
picR.Image = (Image)Clipboard.GetData(DataFormats.Bitmap);
}
Clipboard.Clear();
}
webBrowerObj 是什么?