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";