private void OpenWebPage(string url) { //WebPlayer wp = new WebPlayer(); //wp.Show(); //wp.Play(url); SHDocVw.InternetExplorer ie = new SHDocVw.InternetExplorer(); ie.DocumentComplete += (object pDisp, ref object URL) => { ThreadPool.QueueUserWorkItem((o) => { try { mshtml.HTMLDocument doc = (mshtml.HTMLDocument)ie.Document; doc.bgColor = "black"; doc.getElementById("player").removeAttribute("style"); doc.getElementById("player").setAttribute("width", "100%"); doc.getElementById("player").setAttribute("height", "100%"); doc.getElementById("player").setAttribute("align", "center"); } catch { } }); }; ie.Visible = true; ie.TheaterMode = true; ie.Navigate(url); BringWindowToTop(new IntPtr(ie.HWND)); }
private void SetHtmlValues() { mshtml.HTMLDocument document = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.IHTMLElement textArea1 = document.getElementById("PacientName"); mshtml.IHTMLElement textArea2 = document.getElementById("EventDuration"); textArea1.innerHTML = nombrePaciente; textArea2.innerHTML = duracion.ToString(); }
public static bool PRAP_NewClaimSearch(SHDocVw.InternetExplorer wb, SHDocVw.ShellWindows shells, string Dcn) { if (wb != null) { mshtml.HTMLDocument iePrapDoc = wb.Document; mshtml.HTMLInputElement prapDCNinput = null; iePrapDoc.getElementById("advancedSearch").click(); while (IELib.IEGet(shells, "Advanced Search") == null) { } wb = IELib.IEGet(shells, "Advanced Search"); IELib.IeWait(wb); iePrapDoc = wb.Document; int timeOutCounter = 0; while (prapDCNinput == null) { prapDCNinput = iePrapDoc.getElementsByName("documentControlNumber").item(0); timeOutCounter++; if (timeOutCounter == 50) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); } } try { prapDCNinput.value = "0201" + Dcn; } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); } try { iePrapDoc.getElementById("searchButn").click(); } catch (Exception) { PRAP_Functions.PRAP_CloseWindows(shells); return(false); } while (IELib.IEGet(shells, "Search Results") == null) { } wb = IELib.IEGet(shells, "Search Results"); iePrapDoc = wb.Document; foreach (mshtml.IHTMLElement a in iePrapDoc.getElementsByTagName("a")) { if (a.innerText == "0201" + Dcn) { a.click(); } } while (IELib.IEGet(shells, "Claim Inquiry Details") == null) { } return(true); } else { return(false); } }
public static void PRAP_Login(SHDocVw.InternetExplorer wb, string p) //Start back here { mshtml.HTMLDocument wbDoc = wb.Document; mshtml.HTMLButtonElement wbButton; wbDoc.getElementById("user-name").innerText = System.Environment.UserName; wbDoc.getElementById("password").innerText = p; wbButton = wbDoc.getElementsByTagName("button").item(0); try { wbButton.click(); } catch (Exception) { } IELib.IeWait(wb); }
public void Process(mshtml.HTMLDocument document) { //MessageDialogResult messageResult = await ShowMessageAsync("Authentication Information", String.Format("Username: {0}\nPassword: {1}", result.Username, result.Password)); var userId = document.getElementById("userId"); ClickElement(userId, result.Username); var userPW = document.getElementById("pw"); ClickElement(userPW, result.Password); document.getElementById("loginSubmitBtn").click(); isLogin = true; }
private void button_Click(object sender, RoutedEventArgs e) { mshtml.HTMLDocument document = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.IHTMLElement textArea = document.getElementById("curDate"); //MessageBox.Show(textArea.innerHTML, "Contenido"); this.curValue = textArea.innerHTML; this.Close(); }
public ReplicaPage(string html) { Raw = html; Supplier = new Dictionary <string, string>(); var parser = new FMWW.Http.HTMLParser(html); mshtml.HTMLDocument document = parser.Document; mshtml.IHTMLElementCollection inputs = document.getElementsByTagName("input"); foreach (mshtml.IHTMLElement elm in inputs) { string title = elm.getAttribute("title") ?? ""; var id = elm.id ?? ""; if ((title.Length == 0) || (id.Length == 0)) { continue; } string value = elm.getAttribute("value"); Supplier.Add(title, value); Trace.WriteLine(String.Format("{0} {1} {2}", elm.id, title, value)); try { var input = elm as mshtml.IHTMLInputElement; var suffix = ":select"; var t = title + suffix; var v = ""; mshtml.IHTMLElementCollection spans = document.getElementById(elm.id + suffix).children; foreach (mshtml.IHTMLElement span in spans) { if (span.getAttribute("value") == input.value) { v = span.getAttribute("text"); continue; } } Supplier.Add(t, v); Trace.WriteLine(String.Format("{0} {1} {2}", elm.id + suffix, t, v)); } catch (Exception e) { Trace.WriteLine(e.Message); } } mshtml.IHTMLElement remark = document.getElementById("remark"); Supplier.Add("備考", remark.innerText); }
private void webBrowser1_LoadCompleted(object sender, NavigationEventArgs e) { if (i == 0) { mshtml.HTMLDocument document = (mshtml.HTMLDocument)webBrowser1.Document; var elems = document.getElementsByName("commit"); foreach (mshtml.IHTMLElement button in elems) { mshtml.IHTMLElement k = button; k.click(); i = 1; } webBrowser1.Navigate("https://www.supremenewyork.com/checkout"); } else if (i == 1) { mshtml.HTMLDocument document2 = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.IHTMLInputElement input = (mshtml.IHTMLInputElement)document2.getElementById("order_billing_name"); input.value = name_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("order_email"); input.value = email_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("order_tel"); input.value = tel_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("bo"); input.value = add1_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("oba3"); input.value = add2_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("order_billing_zip"); input.value = zip_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("order_billing_city"); input.value = city_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("cnb"); input.value = number_textbox.Text; input = (mshtml.IHTMLInputElement)document2.getElementById("vval"); input.value = cvv_textbox.Text; mshtml.IHTMLSelectElement select = (mshtml.IHTMLSelectElement)document2.getElementById("order_billing_state"); select.value = state_combobox.Text; select = (mshtml.IHTMLSelectElement)document2.getElementById("credit_card_type"); if (type_combobox.Text == "Visa") { select.value = "visa"; } if (type_combobox.Text == "American Express") { select.value = "american_express"; } if (type_combobox.Text == "Master Card") { select.value = "master"; } select = (mshtml.IHTMLSelectElement)document2.getElementById("credit_card_month"); select.value = month_combobox.Text; select = (mshtml.IHTMLSelectElement)document2.getElementById("credit_card_year"); select.value = year_combobox.Text; var elems = document2.getElementsByName("order[terms]"); foreach (mshtml.IHTMLElement button in elems) { mshtml.IHTMLElement k = button; k.click(); } elems = document2.getElementsByName("commit"); foreach (mshtml.IHTMLElement button in elems) { mshtml.IHTMLElement k = button; k.click(); } i = 2; } }
private void myGetAnswer(object sender, EventArgs e) { mshtml.HTMLDocument document = (mshtml.HTMLDocument)WebBrowser1.Document; mshtml.IHTMLElement textArea = document.getElementById("myStudentInput1"); textBlock.Text = textArea.innerHTML; }
private void mySetQuestion(object sender, EventArgs e) { mshtml.HTMLDocument document = (mshtml.HTMLDocument)WebBrowser1.Document; mshtml.IHTMLElement textArea = document.getElementById("myQuestion1"); textArea.innerHTML = "What is 1+1?"; }
private void browser_LoadCompleted(object sender, NavigationEventArgs e) { if (browser.Document != null) { try { mshtml.HTMLDocument dom = (mshtml.HTMLDocument)browser.Document; //mshtml.IHTMLElement temper=null; switch (model.ToUpper()) { case "ALPHA": //读取温度 Scanner Block Temperature [°C] Alpha仪器 mshtml.IHTMLElement temper = dom.getElementById("SCRTMPCORR"); if (temper != null) { if (!double.TryParse(temper.innerHTML, out Temperature)) { Temperature = -1; } } break; case "MATRIX-I": //读取温度 Scanner Block Temperature [°C] Matrix仪器 mshtml.IHTMLElementCollection temperM = dom.getElementsByTagName("TD"); if (temperM != null) { bool IsFindOut = false; foreach (mshtml.IHTMLElement p in temperM) { if (IsFindOut) { string temp = p.innerHTML; if (!double.TryParse(p.innerHTML, out Temperature)) { Temperature = -1; } break; } if (p.innerHTML.Contains("Scannerblock Temperature")) { //已经找到 IsFindOut = true; } } } break; case "TANGO": mshtml.IHTMLElementCollection temperT = dom.getElementsByTagName("TD"); if (temperT != null) { bool IsFindOut = false; foreach (mshtml.IHTMLElement p in temperT) { if (IsFindOut) { string temp = p.innerHTML; if (!double.TryParse(p.innerHTML, out Temperature)) { Temperature = -1; } break; } if (p.innerHTML != null) { if (p.innerHTML.Contains("Scanner Block Temperature")) { //已经找到 IsFindOut = true; } } } } break; default: break; } //读取激光波数 mshtml.IHTMLElementCollection textArea = dom.getElementsByTagName("B"); foreach (mshtml.IHTMLElement p in textArea) { if (p.parentElement.parentElement.innerHTML != null && p.parentElement.parentElement.innerHTML.Contains("Current NvRAM Data"))//NvRamDataPrev")) { string htmlText = p.parentElement.parentElement.innerHTML; int fx = htmlText.IndexOf("CLWN"); int lx = htmlText.LastIndexOf("CLWN"); string result = htmlText.Substring(fx, lx - fx); result = result.Replace("CLWN>", string.Empty).Replace("</", string.Empty); //string temp1=""; ////result = Regex.Replace(result, @"[\d+.]*", ""); double temp = -1; if (double.TryParse(result, out temp)) { laserWave = temp; } else { laserWave = -1; } // break; //string tempString = p.innerHTML;// lwn.parentElement.innerHTML; //string[] result = tempString.Replace("<TD id=LWN>LWN\r\n<TD>Laser Wavenumber</TD>\r\n<TD>", string.Empty).Split('\r'); ////string[] res=result.s //if (result != null && result.Count() > 0) //{ // if (!double.TryParse(result[0], out laserWave)) // { // laserWave = -1; // } //} } } //int i = 0; //foreach(mshtml.IHTMLElement p in lwn.parentElement.children) //{ // if (i == 0) // { // i++; // continue; // } // if (!double.TryParse(p.innerHTML, out laserWave)) // { // laserWave = -1; // } //} //} //mshtml.IHTMLElementCollection laser = dom.getElementsByTagName("TEXTAREA"); //mshtml.IHTMLElementCollection node = dom.getElementsByTagName("B"); //mshtml.IHTMLElement element=null; //foreach (mshtml.IHTMLElement html in node) //{ // if (html.innerHTML == "Previous Start-Up NvRAM Data") // { // element=html; // } //} //foreach(mshtml.IHTMLElement html in laser) //{ // if(html.parentElement.parentElement.parentElement.parentElement.parentElement==element.parentElement.parentElement) // { // XmlDocument doc = new XmlDocument(); // doc.LoadXml(html.parentElement.parentElement.innerHTML); //加载Xml文件 // XmlElement rootElem = doc.DocumentElement; //获取根节点 // XmlNodeList personNodes = rootElem.GetElementsByTagName("TABLE"); //获取person子节点集合 // foreach (XmlElement node1 in personNodes) // { // foreach (XmlElement child in node1.ChildNodes) // { // //读取IP地址 // if (string.Equals(child.Name, "URL")) // { // } // } // } // } //} //foreach (mshtml.IHTMLElement html in node) //{ // if (html.innerHTML == "Previous Start-Up NvRAM Data") // { // string htmlText = html.parentElement.parentElement.innerHTML; // int fx = htmlText.IndexOf("CLWN"); // int lx = htmlText.LastIndexOf("CLWN"); // string result = htmlText.Substring(fx, lx - fx); // result = result.Replace("CLWN>", string.Empty).Replace("</", string.Empty); // //string temp1=""; // ////result = Regex.Replace(result, @"[\d+.]*", ""); // double temp = -1; // if (double.TryParse(result, out temp)) // { // laserWave = temp; // } // else // { // laserWave = -1; // } // break; // } //} } catch { } this.Hide(); } else { Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new RefreshDelgate(Refresh)); } }
private void getData(mshtml.HTMLDocument doc) { mshtml.IHTMLElement grid = doc.getElementById("Gridvotacion"); List <string> datos = iterateTable(grid.innerHTML); cedula.Text = doc.getElementById("lblcedula").innerText; edad.Text = doc.getElementById("lbledad").innerText; nombre.Text = doc.getElementById("lblnombrecompleto").innerText; conocido.Text = doc.getElementById("lblconocidocomo").innerText; fecha.Text = doc.getElementById("lblfechaNacimiento").innerText; madre.Text = doc.getElementById("lblnombremadre").innerText; cedulaMadre.Text = doc.getElementById("lblid_madre").innerText; padre.Text = doc.getElementById("lblnombrepadre").innerText; cedulaPadre.Text = doc.getElementById("lblid_padre").innerText; nacionalidad.Text = doc.getElementById("lblnacionalidad").innerText; marginal.Text = doc.getElementById("lblLeyendaMarginal").innerText; provincia.Text = datos[0]; canton.Text = datos[1]; distrito.Text = datos[2]; }
void webb_LoadCompleted(object sender, NavigationEventArgs e) { mshtml.HTMLDocument doc = webb.Document as mshtml.HTMLDocument; textBox1.Text = doc.getElementById("lastPrice").ToString(); }
public bool CheckStreamable(String url) { try { ie.Navigate2(url); //wb.ReadyState != WebBrowserReadyState.Complete while (ie.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE) { } mshtml.HTMLDocument vidpage = (mshtml.HTMLDocument)ie.Document; mshtml.HTMLInputElement vid = (mshtml.HTMLInputElement)vidpage.all.item("video-player-tag", 0); if (vid == null) { intbroken++; return(false); } else { if (intsubview > 0) { mshtml.IHTMLElement views = vidpage.getElementById("visits"); string numviews = views.innerText.ToLower().Replace("views", "").Trim(); int intviews = int.Parse(numviews); if (intviews <= intsubview && !sublinks.Contains(url)) { sublinks.Add(url); } } Thread.Sleep(1000); if (fullplay) { double dur = vid.getAttribute("duration"); double curtime = vid.getAttribute("currentTime"); bool past = false; while (curtime != dur && (curtime > .5 || !past)) { if (!past && curtime > .5) { past = true; } curtime = vid.getAttribute("currentTime"); } } } } catch (Exception ex) { if (ex.Message.Equals("The remote server returned an error: (404) Not Found.") || ex.Message.Equals("The remote server returned an error: (500) Internal Server Error.")) { intbroken++; return(false); } else { throw ex; } } return(true); }
private void Button_Click(object sender, RoutedEventArgs e) { htmldoc = webBrowser.Document as mshtml.HTMLDocument; htmldoc.getElementById("i0116").innerText = "*****@*****.**"; htmldoc.getElementById("idSIButton9").click(); }