积极答复者
这种异常怎么处理

问题
-
在c#里,我用浏览器控件访问网站,有的网站会出错,错误信息如下:
"应用程序中发生了无法处理的异常.如果单"继续",应用程序将忽略此错误并尝试继续.如果单击"退出",应用程序将立即关闭.请求的资源在使用中.(异常来自 HRESULT:0X800700AA)."
详细信息如下 :
有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。************** 异常文本 **************
System.Runtime.InteropServices.COMException (0x800700AA): 请求的资源在使用中。 (异常来自 HRESULT:0x800700AA)
在 System.Windows.Forms.UnsafeNativeMethods.IWebBrowser2.Navigate2(Object& URL, Object& flags, Object& targetFrameName, Object& postData, Object& headers)
在 System.Windows.Forms.WebBrowser.PerformNavigate2(Object& URL, Object& flags, Object& targetFrameName, Object& postData, Object& headers)
在 System.Windows.Forms.WebBrowser.PerformNavigateHelper(String urlString, Boolean newWindow, String targetFrameName, Byte[] postData, String headers)
在 System.Windows.Forms.WebBrowser.Navigate(String urlString)
在 WindowsApplication4.Form1.AutoNavigateWeb() 位置 H:\业余\vbInternet\WindowsApplication4\WindowsApplication4\Form1.cs:行号 67
在 WindowsApplication4.Form1.timer1_Tick(Object sender, EventArgs e) 位置 H:\业余\vbInternet\WindowsApplication4\WindowsApplication4\Form1.cs:行号 42
在 System.Windows.Forms.Timer.OnTick(EventArgs e)
在 System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** 已加载的程序集 **************
mscorlib
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
WindowsApplication4
程序集版本: 1.0.0.0
Win32 版本: 1.0.0.0
基本代码: file:///F:/tianmd/other/业余/vbInternet/复件%20(2)%20WindowsApplication4_20100305/WindowsApplication4/bin/Debug/WindowsApplication4.exe
----------------------------------------
System.Windows.Forms
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.mshtml
程序集版本: 7.0.3300.0
Win32 版本: 7.0.3300.0
基本代码: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
----------------------------------------
mscorlib.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Windows.Forms.resources
程序集版本: 2.0.0.0
Win32 版本: 2.0.50727.42 (RTM.050727-4200)
基本代码: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_zh-CHS_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。例如:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>启用 JIT 调试后,任何无法处理的异常
都将被发送到在此计算机上注册的 JIT 调试器,
而不是由此对话框处理。
田田qq:764574267
答案
-
你好,
那你直接把这个脚本错误给disbale掉算了。这样也不影响你了。
可以参考下面的例子。
http://blog.csdn.net/DavidHsing/archive/2010/02/24/5321700.aspx
http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx
Microsoft Online Community Support- 已标记为答案 ttsoft888 2010年4月19日 3:49
全部回复
-
我用浏览器试了没有问题.
//.....
int i;
string strName;int len;
string link_url;
int n = webBrowser1.Document.Links.Count;
for (i = 0; i < n; i++)
{
link_url = webBrowser1.Document.Links[i].GetAttribute("href");
len = link_url.Length; //执行这一句时报错的//.......
运行一直是正常的,运行一段时间后,当弹出一个错误对话框时,"len = link_url.Length; "这一句才报错.
错误对话框信息如下:
"出现了运行时间错误,是否要进行调试?"
行:52
错误:缺少对象
田田qq:764574267
-
你好,
那你直接把这个脚本错误给disbale掉算了。这样也不影响你了。
可以参考下面的例子。
http://blog.csdn.net/DavidHsing/archive/2010/02/24/5321700.aspx
http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx
Microsoft Online Community Support- 已标记为答案 ttsoft888 2010年4月19日 3:49