/// <summary> /// 还要加一个该控件的事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void axWebBrowser1_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { Object o = e.pDisp; oDocument = o.GetType().InvokeMember("Document", BindingFlags.GetProperty, null, o, null); Object oApplication = o.GetType().InvokeMember("Application", BindingFlags.GetProperty, null, oDocument, null); Object oName = o.GetType().InvokeMember("Name", BindingFlags.GetProperty, null, oApplication, null); }
void Browser_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { // Pass the valid document and window objects and build // a link report on the document BuildLinkReport(); // Sink script errors for this window instance SinkScriptErrorEvents(); }
protected void AxWebBrowser_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { IHTMLDocument4 id4; object boxID4 = AxWebBrowser.Document; id4 = (IHTMLDocument4)boxID4; // For testing only... }
private void axWebBrowser1_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { //Note: You can use the reference to the document object to // automate the document server. try { Object o = e.pDisp; oDocument = o.GetType().InvokeMember("Document", BindingFlags.GetProperty, null, o, null); //Object oApplication = o.GetType().InvokeMember("Application", BindingFlags.GetProperty, null, oDocument, null); //Object oName = o.GetType().InvokeMember("Name", BindingFlags.GetProperty, null, oApplication, null); //MessageBox.Show("File opened by: " + oName.ToString()); } catch (Exception exception) { Console.WriteLine(exception); throw; } }
private void AxWebBrowser_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { BrowserNavigateComplete2EventArgs args = new BrowserNavigateComplete2EventArgs(e.pDisp, (string)e.uRL); OnNavigateComplete2(args); }
void Browser_NavigateComplete2(object sender, DWebBrowserEvents2_NavigateComplete2Event e) { // Set the address box text to the current URL AddressBox.Text = Browser.LocationURL; }