Click here to Skip to main content
15,668,923 members
Please Sign up or sign in to vote.
1.77/5 (6 votes)
See more:
Hi. I have a simple question in c#. I have build an application with windows form that has a textbox and a button. When an user writes a word in this textbox and press in button , this application searches textbox.text in the web with and then saves results in a text file. I have no use google api. please help me.
Updated 13-Aug-17 5:09am
Nelek 12-Apr-12 17:40pm    
And the question is?
[no name] 12-Apr-12 18:40pm    
You are going to have to be more clear in your question. There isn't even an identifiable question in your narrative.
HosseinGhodsi 12-Apr-12 23:48pm    
excuse me. my question is: Where should I start?
bbirajdar 2-Apr-13 6:25am    
Start with opening the visual studio with project you want to work on...

With Httpwebrequest object and its options I`ve solved this problem. thanks of all.
StringBuilder sb = new StringBuilder();

           // used on each read operation
           byte[] buf = new byte[8192];
           string GS = "";
           // prepare the web page we will be asking for
           HttpWebRequest request = (HttpWebRequest)WebRequest.Create(GS);

           // execute the request
           HttpWebResponse response = (HttpWebResponse)request.GetResponse();

           // we will read data via the response stream
           Stream resStream = response.GetResponseStream();
           string tempString = null;
           int count = 0;
               // fill the buffer with data
               count = resStream.Read(buf, 0, buf.Length);
               // make sure we read some data
               if (count != 0)
                   // translate from bytes to ASCII text
                   tempString = Encoding.ASCII.GetString(buf, 0, count);

                   // continue building the string
           while (count > 0);
Share this answer
fjdiewornncalwe 13-Apr-12 15:06pm    
Thanks for sharing your solution. +5.
Shahin Khorshidnia 13-Apr-12 15:31pm    

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