private void wb1_LoadCompleted(object sender, System.Windows.Navigation.NavigationEventArgs e) { string[] SourceName = wb1.Source.ToString().Split(new char[] { '#', '/', '&', '=', ':', '?' }, StringSplitOptions.RemoveEmptyEntries); HTMLDocument doc = (HTMLDocument)wb1.Document; if (SourceName[6] == "page") { IHTMLElementCollection theElementCollection = doc.getElementsByName("email"); foreach (IHTMLElement curElement in theElementCollection) { curElement.setAttribute("value", Properties.Settings.Default.BotLogins[0]); } theElementCollection = doc.getElementsByName("pass"); foreach (IHTMLElement curElement in theElementCollection) { curElement.setAttribute("value", Properties.Settings.Default.BotPasswords[0]); doc.getElementById("install_allow").click(); } theElementCollection = doc.getElementsByClassName("flat_button fl_r button_indent"); foreach (IHTMLElement curElement in theElementCollection) { curElement.click(); } } else if (SourceName[2] == "blank.html") { _token = SourceName[4]; this.Close(); } }
public override string getErr_Msg(HtmlDocument indoc) { if (indoc == null) { return(null); } HTMLDocument doc = indoc.DomDocument as HTMLDocument; IHTMLElementCollection hcols = doc.getElementsByClassName("err_msg"); if (hcols.length == 0) { return(null); } var item = hcols.item(null, 0); return(item.innerText); }
public override string getChargeNum(HtmlDocument indoc) { if (indoc == null) { return(null);//网页文档对象为空 } HTMLDocument doc = indoc.DomDocument as HTMLDocument; IHTMLElementCollection hcols = doc.getElementsByClassName("order-number"); if (hcols.length == 0) { return(null); } var item = hcols.item(null, 0); return(item.innerText); }