geckowebbrowser和invoke成员 [英] geckowebbrowser and invoke member

查看:81
本文介绍了geckowebbrowser和invoke成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
i使用geckowebbrowser在我的窗体应用程序中加载页面

i用IE和webbrowser控件做这个,当这个窗体加载我的目标页面时

i填写表单的文本框并以编程方式单击按钮

使用此命令



wb是webbrowser的实例

 htmlelement usr = wb.Document.All [  TXTCONTROL id ] 
usr.innertext = 我的数据;

wb.document.getelementbyid( BUTTON NAME)。invokmember( 点击);



现在如何用geckowebbrowser做什么?

请帮帮我

谢谢

解决方案

 geckoWebBrowser1。 DomDocument.GetElementById(IdHere)。SetAttribute(value,textBox1.Text); 
geckoWebBrowser1.DomDocument.GetElementById(IdHere)。SetAttribute(value,textBox2.Text);

GeckoHtmlElement SwagSubmitField =
(GeckoHtmlElement)geckoWebBrowser1.DomDocument.GetElementById(loginBtn);
SwagSubmitField.Click();

//自定义函数等待两秒钟,确保注册点击
//进行下一步操作
Ticker.Time(2);


hi i used a geckowebbrowser for loadnig a page in my form windows application
i did this with IE and webbrowser control and when this form load my target page
i filled the textbox of forms and click the button programmatically
with this commands

wb is instance of webbrowser

htmlelement usr=wb.Document.All["TXTCONTROL id"]
usr.innertext="MY DATA";

wb.document.getelementbyid("BUTTON NAME").invokmember("click");


now how do it with geckowebbrowser?
please help me
thanks

解决方案

                    geckoWebBrowser1.DomDocument.GetElementById("IdHere").SetAttribute("value", textBox1.Text);
                    geckoWebBrowser1.DomDocument.GetElementById("IdHere").SetAttribute("value", textBox2.Text);

GeckoHtmlElement SwagSubmitField =
      (GeckoHtmlElement)geckoWebBrowser1.DomDocument.GetElementById("loginBtn");
SwagSubmitField.Click();

//Custom Function To wait for two seconds, To make sure that "Click" is registered 
//be for going to next action
Ticker.Time(2);


这篇关于geckowebbrowser和invoke成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆