Using Bing API in C#
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
精彩评论