|
如何在complete事件完成后,点击相关按钮后再次加载complete事件
private void webBrowser1_DocumentCompleted_1(object sender, WebBrowserDocumentCompletedEventArgs e)
{
if (webBrowser1.ReadyState != WebBrowserReadyState.Complete) return;
if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)
{
lab_xyd_dl.Visible = true;
if (webBrowser1.Document.Window.Frames.Count > 1)
{
//进入相应班
HtmlElement btnAdd1 = webBrowser1.Document.Window.Frames[1].Document.GetElementById("ids");
if (btnAdd1 != null) btnAdd1.InvokeMember("click");
btnAdd1 = webBrowser1.Document.Window.Frames[1].Document.GetElementById("nowshift");
if (btnAdd1 != null) btnAdd1.InvokeMember("click");
Wait();
System.Threading.Thread.Sleep(2000);
foreach (HtmlElement he in webBrowser1.Document.Window.Frames[1].Document.All)
{
if (he.OuterHtml == "<button style=\"padding: 0px 10px;\" class=\"jbox-button jbox-button-focus\" value=\"ok\">确定</button>")
{
he.InvokeMember("click");
}
}
}
}
|
|