Google Search for .NET application

Published on by Inno Design


Today we are going to talk about building a software that search throgh google right from your desktop. There can be many application of such software like:

  • for making search engine for searching books in your ebook reader
  • for pdf reader you can give a search engine for direct download and reading purposes
  • for image download
  • for searching and downloading videos

Now let’s come to the point “HOW TO CODE”

well for making such application is very simple

you’ll need an API(Application platform installer) for fetching results from Google. here’s the link to get API

The application needs framework 3.5

Now for searching make click event of search button as

private void button1_Click(object sender, EventArgs e)
web = new GwebSearchClient(referrer);
w_result= web.Search(textBox1.Text, 20, “en-us”);
flowLayoutPanel1.Height = this.Height – panel1.Height – panel2.Height-5;
for (int i = 0; i < w_result.Count; i++)
Label lblR = new Label();
lblR.Text = w_result[i].Title;
lblR.Width = flowLayoutPanel1.Width;
Label lblCon = new Label();
lblCon.Width = flowLayoutPanel1.Width;
lblCon.Text = w_result[i].Content;
lblCon.Top = lblR.Top + 10;
LinkLabel lnkUrl = new LinkLabel();
lnkUrl.Text = w_result[i].Url;

I have taken flowlayout control for binding results

web is object of class “Google.API.Search.GwebSearchClient” provided with the API.

as you can see this is object of GwebSearchclient so it fetches the web results. in the same fashion you can extract image results by using GimageSearchClient, book results with GbookSearchClient etc

that’s all for today’s tips.

Happy coding :)

Published on Windows form

Comment on this post