简体   繁体   English

如何为webBrowser控件文本框提供值?

[英]How can I give values to webBrowser control text boxes?

Please go to this website : http://www.dofellow.com/ and see the software video. 请访问此网站: http : //www.dofellow.com/并查看软件视频。

This guy is giving values to webBrowser control text boxes from database / datagrid / textbox etc. 这个家伙正在从数据库/ datagrid /文本框等为webBrowser控件文本框提供值。

Can anyone tell me how is he doing that ? 谁能告诉我他是怎么做的? I think every website have different ids for text boxes then how he is giving values to those fields ? 我认为每个网站的文本框都有不同的ID,那么他如何为这些字段赋值?

Also, how is he searching for do follow links on google ? 另外,他如何搜索Google上的跟踪链接? Can anyone share the search query with me? 谁能和我分享搜索查询?

Thanks in advance. 提前致谢。

I think this guy gets these text boxes imprecisely. 我认为这个人不正确地获得了这些文本框。 Maybe it won't work correctly for a site with following code: 对于具有以下代码的网站,它可能无法正常工作:

<input type="text" id="email" />   **His code will put the name into this field**
<input type="text" id="displayName" />   **emails will be put here**
<textarea id="comment"></textarea>

To change the values of these HTML controls, we can use: 要更改这些HTML控件的值,我们可以使用:

WebBrowser wb = new WebBroswer();
wb.Navigate("http://www.google.com");
wb.Document.GetElementById("theID") or GetElementByTagName etc.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM