How To set “Textbox” value in Gecko Browser?

女生的网名这么多〃 提交于 2020-01-13 06:39:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!