0

I was looking for simple sample code for implementing web search on my vb.net application using Bing’s API. I cannot find anything interesting.

oleksii
  • 35,458
  • 16
  • 93
  • 163
Gino Strato
  • 327
  • 3
  • 13
  • What have you tried? What is your task? Please define "anything interesting". Is [this](http://www.bing.com/developers/s/APIBasics.html) not clear enough? – oleksii Jul 07 '12 at 08:59
  • You are right, but the link Giuseppe provided me makes clear what I meant by "interesting". – Gino Strato Jul 09 '12 at 07:14

2 Answers2

0

I've used few lines of code provided on this page: API code I think to understand what you mean when you write "interesting": minimal and easy to understand.
If so, there you will find what you need. There is also c# code.

Giuseppe Dini
  • 762
  • 7
  • 19
0

'Example uses the standard azure bing search api not web only

'Need to complile the BingSearchContainer.cs file from the data center account page into 'class library.

'Add reference to it and System.Data.Services.Client

'Get it here https://datamarket.azure.com/dataset/explore/getproxy/

'Complete example with xaml and result listbox http://codepaste.net/jfks5h

 Dim strBingKey As String = "W1QPif2PUhkuSiyoMze324324234234"
        Dim bingClass As New Bing.BingSearchContainer(New Uri("https://api.datamarket.azure.com/Bing/Search/"))
        bingClass.Credentials = New NetworkCredential(strBingKey, strBingKey)

        Dim query = bingClass.Video("site:somesite.com test", Nothing, Nothing, "Off", Nothing, Nothing, Nothing, Nothing)
        Dim results = query.Execute()
        For Each result In results
            Console.WriteLine(result.Title)
            Console.WriteLine(result.MediaUrl)
            Console.WriteLine(result.RunTime)
            Console.WriteLine(result.Thumbnail) 'ThumbNail type, need to convert to use in result list

        Next
DaveCS
  • 950
  • 1
  • 10
  • 16