HtmlElement.InvokeMember,怎么等到页面加载? [英] HtmlElement.InvokeMember, how wait until page loaded?

查看:164
本文介绍了HtmlElement.InvokeMember,怎么等到页面加载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的C#应用​​程序我使用WebBrowser对象读取HTML包括回发。为了通过获得页面读取默认页我用WebBrowserDocumentCompletedEventHandler,如:

In my C# application I use WebBrowser object to read html include postbacks. To read default page by getting page I use WebBrowserDocumentCompletedEventHandler, like:

WebBrowser wb = new WebBrowser();
wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(wb_DocumentCompleted);
wb.Navigate("http://mysite.com");

然后在该事件中,我有一个网页:

then in that event I have a page:

private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
    IsDocumentComplete = true;
    // here I can read the page
}

那么,该事件触发每次当我打电话导航方法,但是当我在页面上的一些元素,调用回传,我需要再次重新等待页面加载:

So, that event fires every time when I call Navigate method, but when I get some element on the page, invoke postback, I need to wait again until page loads again:

button.InvokeMember("onclick");

在这种情况下wb_DocumentCompleted不火。

in that case wb_DocumentCompleted doesn't fire.

什么是知道什么时候完全加载页面的方式。

What is the way to know when page completely loaded.

鸭preciate任何帮助。谢谢!

Appreciate any help. thanks!

推荐答案

检查这些链接,我想这些链接将帮助您

Check these links , I think these links will help you

第一个环节:
<一href=\"http://stackoverflow.com/questions/5832710/how-to-determine-when-page-is-loaded-completely-in-webbrowser-control-in-csharp\">how以确定何时页面在CSHARP WebBrowser控件完全加载?

第二个链接:

<一个href=\"http://stackoverflow.com/questions/1996268/how-to-know-that-webbrowser-control-has-finished-loading-all-content-including-f\">How要知道,WebBrowser控件已完成加载所有内容,包括闪光灯?

这两个链接都与你的问题,请检查它们,这些链接会回答你的问题。

These both links are related to you question, Please check them , Those links will answer your question

这篇关于HtmlElement.InvokeMember,怎么等到页面加载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆