|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am using Visual studio and have created a project in vb.net. I have carried out the simple search and return the number of hits, I am banging my head against a wall trying to return the title, urls and snippets of the matches. I know it most likely has to do with arrays and ASP. Once I have done this I would like to show the results on my web page., most likely do the search from the web page itself. If anyone could advise me, I would be extremely happy.
Thanks Paul |
|
#2
|
||||
|
||||
|
Not really sure what you're talking about here. Where are the hits being stored? In a database, a file, the logs?
How are you querying this hits storage? |
|
#3
|
|||
|
|||
|
I have used the tutorial on Implementing The Google Web Service In VB.NET (in DevArticles). I am having difficulties returning the title, url and snippet of the results back to the vb.net project form.
Dim i As Int32 Dim max As Int32 Dim displayTitle As String Dim maxResults As Int32 = 10 Dim _Query As String Dim _formatString As String = "{0}. <a href=""{2}"">{1}</a><br>" ' create a Google Search object Dim MyServiceb As Google.GoogleSearchService = New Google.GoogleSearchService() ' invoke the search method Dim MyResultb As Google.GoogleSearchResult MyResultb = MyServiceb.doGoogleSearch(MyLicenseKey, txtsearch.Text, 0, _maxResults, False, "", False, "", "", "") ' loop through formatting each result For i = 0 To 10 ' if the title for this result is blank use the URL instead If (MyResultb.resultElements(i).title <> "") Then DataGrid1.Text = CObj(MyResultb.resultElements(i).title) 'displayTitle = MyResultb.resultElements(i).title 'Else ' displayTitle = MyResultb.resultElements(i).URL() End If ' format this result line 'sb.Append(String.Format(_formatString, (i + 1), displayTitle, MyResultb.resultElements(i).URL, MyResultb.resultElements(i).snippet)) Next i End Sub Is a datagrid the right toolbar option to use? I know I have ' some of the lines as am trying to get the one array back for one of the title,url or snippet, before I try to join them. I am extremely new to vb.net programming so and help you could give me would be very useful. Paul |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Returning Title Url and snippet |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|