-2

How to copy and paste the value or text from Google search box to ask.com's search box?

Please imagine a windows application with one webbrowser box on the left side and another webbrowser box on the right side, all embedded evenly in the same one windows application form.

I want to add a button that copies the value or text from Google search box and then converts these characters into a uppercase and then pastes it on the Ask.com's search box.

Google's searchbox ID is "lst-ib" and ask.com's search box ID is "q"

How do you programmatically copy and paste the value or text from Google search box to ask.com's search box?

4

1 回答 1

1

您可以从 URL 中获取搜索词(在DocumentCompleted事件中),然后构建一个适当的 ask.com 搜索 URL。

或者您可以(再次在DocumentCompleted或在您的按钮单击处理程序中)使用标准 DOM 方法来获取值:

HtmlElement searchBox = GoogleBrowser.Document.getElementById("lst-ib");
于 2012-04-10T17:15:37.607 回答