开发者

Using Bing API in C#

开发者 https://www.devze.com 2023-02-06 04:42 出处:网络
How do we use the Bing API 开发者_JAVA百科in C#? I have to pass a query to the Bing API and then get the results.BingService.BingService service = new BingService.BingService();

How do we use the Bing API 开发者_JAVA百科in C#? I have to pass a query to the Bing API and then get the results.


BingService.BingService service = new BingService.BingService();

        SearchRequest request = new SearchRequest();
        // use your Bing AppID
        request.AppId = ""; /* Your App ID */
        request.Query = "rose"; // your search query

        // I want to search only web
        request.Sources = new SourceType[]
        {
            SourceType.Image 
        };

        SearchResponse response = service.Search(request);

        foreach (ImageResult result in response.Image.Results)
        {

            //lstBxImages.Items.Add("<a href="+result.Url + '"'+"></a>" + result.Title);
            imgliteral.Controls.Add(new LiteralControl("<img src=" + result.MediaUrl + " width=100


Download bing dlls from microsoft site and add those dlls . Then only we can able to use bing service.


Here's something will help you a lot https://github.com/insatmc/BingMapHelper


Just adding to above there is a full documentation of te API given by BING in a PDF.

Here is a Basic Details Version


hii..

Add a bing reference to web references in an application and use search.wsdl

0

精彩评论

暂无评论...
验证码 换一张
取 消