using System.Windows.Forms.HtmlElement; HtmlElementCollection theElementCollection; theElementCollection = Browser.webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement curElement in theElementCollection) { if ((curElement.GetAttribute("id").ToString() == "_ctl0_PlaceHolderMain_Loginapp2_txtLoginUsername")) { curElement.SetAttribute("Value", id.Text); } else if ((curElement.GetAttribute("id").ToString() == "_ctl0_PlaceHolderMain_Loginapp2_txtLoginPassword")) { curElement.SetAttribute("Value", pw.Text); } } theElementCollection = Browser.webBrowser1.Document.GetElementsByTagName("input"); foreach (HtmlElement curElement in theElementCollection) { if (curElement.GetAttribute("id").Equals("_ctl0_PlaceHolderMain_Loginapp2_btnLoginLogin")) { curElement.InvokeMember("click"); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)