Windows 8 Integrated Development Bing search service

Source: Internet
Author: User

I. Bing search introduction:

Search type:Web,Image,News, Instantanswer,Video,Relatedsearch,Spell

  Supported protocols: JSON, XML, and soap

Register the development ID http://www.bing.com/toolbox/bingdeveloper/ to get an applicationid

 

Ii. development overview

Take the Web Service of SOAP (C # as an example)

Reference http://api.bing.net/search.wsdl? Appid = yourappid & version = 2.2, and then

public class BingSearch    {        public async void SearchWebAsync(string keyWords)        {            BingPortTypeClient service = new BingPortTypeClient();                           try                {                    SearchRequest1 request = new SearchRequest1();                    request.parameters = new SearchRequest();                    request.parameters.AppId = Constant.BingAppId;                    request.parameters.Query = keyWords; ;                    request.parameters.Sources = new SourceType[] { SourceType.Web };                    request.parameters.Version = "2.2";                    request.parameters.Market = "zh-cn";                    request.parameters.Adult = AdultOption.Moderate;                    request.parameters.AdultSpecified = true;                    // Send the request; display the response.                    SearchResponse1 response = await service.SearchAsync(request);                }                                catch (System.Net.WebException ex)                {                    // An exception occurred while accessing the network.                                   }                    }    }

The result in response is the result set.

 

Search examples on msdn

Http://msdn.microsoft.com/en-us/library/dd250847

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.