private void etoBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { HtmlDocument myDoc; string sUrl = e.Url.ToString(); // if (sUrl.StartsWith("https://secure.etosoftware.com/Modules/Dashboard/Personal.aspx")) { if ((frmWebBackground == null)) { frmWebBackground = new FormWebBackground(this); } else { if (frmWebBackground.IsDisposed) { frmWebBackground = new FormWebBackground(this); } } //frmWebBackground.webBackground.Navigate("https://secure.etosoftware.com/SearchForClientResultExpanded.asp?fromNav=yes&SearchResult=Enter%20Search%20Term%28s%29"); } if (sUrl.StartsWith("https://secure.etosoftware.com/Modules/Dashboard/Participant.aspx?ActorID=C")) { myDoc = etoBrowser.Document.Window.Frames["Body"].Document; string sForm = myDoc.GetElementById("form1").OuterHtml.ToString(); int sc = sForm.IndexOf("ActorID=C", StringComparison.OrdinalIgnoreCase) + 9; int ec = sForm.IndexOf(" Method=Post", StringComparison.OrdinalIgnoreCase); int nc = ec - sc; sCLID = sForm.Substring(sc, nc); comboBox1.Items.Add(sCLID); comboBox1.Visible = true; } }
private void showBackgroundToolStripMenuItem_Click(object sender, EventArgs e) { if ((frmWebBackground == null)) { frmWebBackground = new FormWebBackground(this); } else { if (frmWebBackground.IsDisposed) { frmWebBackground = new FormWebBackground(this); } } frmWebBackground.webBackground.Navigate("https://secure.etosoftware.com/SearchForClientResultExpanded.asp?fromNav=yes&SearchResult=Enter%20Search%20Term%28s%29"); try { frmWebBackground.Show(); } catch { // Don't do anything. Object has been closed } }