winform中如何实现自动点击webbrowser弹出对话框中的确定按钮
Q:winform中如何实现自动点击webbrowser弹出对话框中的确定按钮A:
<div style="padding: 4px 5.4pt; width: 95%;">http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif//usingmshtml;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif//usingSHDocVw;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifprivatevoidForm1_Load(objectsender,EventArgse)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifthis.webBrowser1.Navigate("http://localhost:28512/WebSite2/Default.aspx");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifSHDocVw.WebBrowserwb=this.webBrowser1.ActiveXInstanceasSHDocVw.WebBrowser;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifwb.NavigateComplete2+=newSHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(wb_NavigateComplete2);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifvoidwb_NavigateComplete2(objectpDisp,refobjectURL)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifmshtml.IHTMLDocument2doc=(this.webBrowser1.ActiveXInstanceasSHDocVw.WebBrowser).Documentasmshtml.IHTMLDocument2;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifdoc.parentWindow.execScript("functionalert(str){return''}","javascript");
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
页:
[1]