private void Window_Error(object sender, HtmlElementErrorEventArgs e)
{ e.Handled = true;
}
void axBrowser_NavigateError(object pDisp, ref object URL, ref object Frame, ref object StatusCode, ref bool Cancel)
{ } 我用Window_Error捕捉不到脚本错误事件,被axBrowser_NavigateError事件截获了,但是在axBrowser_NavigateError我要处理网页错误信息如404错误信息等等,请问如何彻底屏蔽脚本错误信息啊,包括JS、VBscript脚本。
{ e.Handled = true;
}
void axBrowser_NavigateError(object pDisp, ref object URL, ref object Frame, ref object StatusCode, ref bool Cancel)
{ } 我用Window_Error捕捉不到脚本错误事件,被axBrowser_NavigateError事件截获了,但是在axBrowser_NavigateError我要处理网页错误信息如404错误信息等等,请问如何彻底屏蔽脚本错误信息啊,包括JS、VBscript脚本。
解决方案 »
- C#委托实现刷新页面
- 密码包含大小写字母、数字以及非字母字符的正则表达式
- 怎样根据文件夹结构生成一棵树?
- 如何让一个ToolStrip漂浮起来?
- 如果用.net多个组件实现出库单业务逻辑实战
- (在线急等)关于ListItem在windows应用程序中的问题
- 请教高手: 用C#如何实现多人聊天程序?并且有声音提示.在线等待中..........
- 在ASP.NET 2.0中为什么每次编译部署后BIN\下的那个DLL都在变??
- tab键顺序
- 请教:关于DataSet.WriteXml()方法得到的结果的根元素名字总是<NewDataSet>怎么把它改掉?
- [十万火急]关于playsound()函数
- iis应用程序池最大进程数配置为2,页面出错!
{ //e.Handled = true; 注释掉
}
// Hides script errors without hiding other dialog boxes.
// This method call in MainForm.Load handler.
private void SuppressScriptErrorsOnly(WebBrowser browser)
{
// Ensure that ScriptErrorsSuppressed is set to false.
browser.ScriptErrorsSuppressed = false; // Handle DocumentCompleted to gain access to the Document object.
browser.DocumentCompleted +=
new WebBrowserDocumentCompletedEventHandler(
browser_DocumentCompleted);
}private void browser_DocumentCompleted(object sender,
WebBrowserDocumentCompletedEventArgs e)
{
((WebBrowser)sender).Document.Window.Error +=
new HtmlElementErrorEventHandler(Window_Error);
}private void Window_Error(object sender,
HtmlElementErrorEventArgs e)
{
// Ignore the error and suppress the error dialog box.
e.Handled = true;
}