Click here to Skip to main content
15,887,338 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey I made one windows form app.; in taht form1 is contain one textbox and one button,and form2 contains webbrowser with url "www.google.com"...what type of code i have to write to pass the value from textbox of form1 to serchbar of google in opened in form2 ????....(Note: when I run my app. form1 will appeared....then form2 is appered on clicking of button of form1)
Posted

Kick off the default browser from your app, with the custom URL that used for the google search. Look at the following URL, you can find the pattern to search "code project"

<a href="http://www.google.com/search?q=code+project&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a">http://www.google.com/search?q=code+project&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a</a>[<a href="http://www.google.com/search?q=code+project&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a" target="_blank" title="New Window">^</a>]

The simple form of the URL is,

<a href="http://www.google.com/search?q=code+project">http://www.google.com/search?q=code+project</a>[<a href="http://www.google.com/search?q=code+project" target="_blank" title="New Window">^</a>]

You no need to worry about other parameters.
 
Share this answer
 
v2
Comments
NikulDarji 19-Sep-11 7:25am    
Thanx,,,,:)
CodingLover 19-Sep-11 12:17pm    
Did you solve the problem.
NikulDarji 20-Sep-11 2:34am    
Ya I solved the problem....but as u said, I have to think about other parameters....!!!
CodingLover 20-Sep-11 2:42am    
That is good actually. Those are like text format, client details and so on.
Sometimes it is hard to find the correct element nested deep in a webpage.
Simple solution
Iterate through all elements
If the element is an input then
fill the element with the text
end if
next

submit the form
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900