Web Page Design and Hosting

December 31, 2006

6.Add the following SubMainprocedure to Module1of your project:

Filed under: professional development with web apis — webmaster @ 11:30 pm

6.Add the following SubMainprocedure to Module1of your project: Sub Main() Create a Google Search objectDim Search As New Google.GoogleSearchServiceDim strLicense As StringDim strSearchText As StringDim intStart As IntegerDim intMaxResults As Integer set the values to pass to the Google web servicestrLicense = YOUR KEY GOES HERE strSearchText = web service API intStart = 0intMaxResults = 3Try execute the doGoogleSearch method (i.e. run the Google Search) Dim SearchResult As Google.GoogleSearchResult = _ Search.doGoogleSearch(strLicense, strSearchText, _ intStart, intMaxResults, False, , False, , , ) if no results were returned then exitIf SearchResult.resultElements Is Nothing Then Exit Sub write the results to the consoleDim result As Google.ResultElementFor Each result In SearchResult.resultElementsConsole.WriteLine() Console.WriteLine(result.title) Console.WriteLine(result.URL) Console.WriteLine(result.snippet) Console.WriteLine() Next get input from the user so display will pause until enter pressedConsole.ReadLine() Catch exception As System.Web.Services.Protocols.SoapExceptionMsgBox(exception.Message) End TryEnd Sub7.Input your developer license key on the line of code that says YOURKEYGOESHERE. 8.Select File.Save All to save all changes to the project. 9.Select Debug.Start (or press F5) to run the project. You should see a console window similarto Figure 2-9 that retrieves information from the Google API based on the criteria specified code.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Inexpensive Web Hosting services


No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Java Web Hosting