栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

使用C#.NET WebBrowser控件导航到不同的网站出现 所请求的资源正在使用中。 (从HRESULT异常:0x800700AA)

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用C#.NET WebBrowser控件导航到不同的网站出现 所请求的资源正在使用中。 (从HRESULT异常:0x800700AA)

解决方案

WebBrowser控件被认为是"使用中"如果有一个正在处理的导航操作,或控制任何阻塞对话是当前打开的(包括上下文菜单,Javascript警告,NTLM登录对话框,等等)。您可以使用 WebBrowser.IsBusy 属性来检测这些状态。

如果由于当前不完整的导航操作,你可以尝试停止当前的导航(如果你确实想停止网页时未完成加载),或者添加新的导航到一个请求队列,并使用定时器等待直到 WebBrowser.IsBusy 返回false。

如果不是占线状态是由于一个或多个打开的对话​​框阻止,你可以做同样的等待技术也许 Messagebox.Show()用户一条消息,未决的导航由于延迟一个开放的对话窗口。

原文

The WebBrowser control is considered "in use" if either a navigation action is currently being processed, or any blocking dialog from the control is currently open (including context menu, Javascript alerts, NTLM login dialog, etc.). You can use the WebBrowser.IsBusy property to detect these states.

If due to a currently incomplete navigation action, you could try to stop the current navigation (if you indeed want to stop when the page is not completed loaded) or add the new navigation to a request queue and use a timer to wait until WebBrowser.IsBusy returns false.

If instead the busy state is due to one or more open blocking dialogs, you could do the same wait technique and perhaps Messagebox.Show() the user a message that pending navigation is delayed due to an open dialog window.

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/605334.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号