tags:

views:

93

answers:

2

Possible Duplicate:
how to insert value to textbox - website

hi

how to open www.google.com and insert any text to the textbox search (only for show)

in C# Winforms ?

thank's in advance

A: 

You can use WebBrowser control present in windows application.

Use AxSHDocVw.AxWebBrowser control, along with MSHTML which provides Internet Explorer with complete HTML Document Object Model parsing. You need to use following Windows ActiveX objects.

1 mshtml.tlb

2 SHDocVw.dll

You can find them in your windows/system32 directory.

And try following code Set the navigation url of the webbroser control as following

string url="http://www.google.com";

    Object o = null;

    //fetch the page to your web browser.

    WebBrowser1.Navigate(url, ref o, ref o, ref o, ref o);

Using follow code you can set the text value

mshtml.HTMLDocument obj= (mshtml.HTMLDocument)WebBrowser1.Document;
obj.getElementById("TEXTBOXNAME").innerText=“Some value“;
Prakash Kalakoti
+1  A: 

try like this

     System.Diagnostics.Process.Start("http://www.google.com/#q=SampleText");
Pramodh
thank's for the help, how did you know that #q is the textbox ?if i need to put some text in another web how to find the textbox ?
Gold