问题
if its Source name="login" then how can i set User Name Value Source Html For userbname textbox:
回答1:
Gecko is not that different with IE . try this way
{
HtmlElementCollection elements = Geckowebbrowser1.Document.GetElementsByTagName("input");
elements(1).SetAttribute("value", USERBOX.Text);
elements(2).SetAttribute("value", PASSBOX.Text);
elements(3).InvokeMember("Click");
}
回答2:
Its simple in GeckoBrowser
. Following two lines will set the Textbox
value:
GeckoInputElement txtbox = new GeckoInputElement(geckobrowser1.Document.GetElementByName("login").DomObject);
txtbox.Value = "Your string";
来源:https://stackoverflow.com/questions/11518840/how-to-set-textbox-value-in-gecko-browser