【问题标题】:Bing Search API sample code not working必应搜索 API 示例代码不起作用
【发布时间】:2013-09-20 00:18:15
【问题描述】:

有没有人让 Bing API C# 示例代码工作?我指的是此页面上的 Web 示例:https://skydrive.live.com/view.aspx?resid=9C9479871FBFA822!112&app=Word&authkey=!ANNnJQREB0kDC04

我也在使用 BingSearchContainer.cs 文件

string rootUri = "https://api.datamarket.azure.com/Bing/Search";

var bingContainer = new Bing.BingSearchContainer(new Uri(rootUri));

var accountKey = "Zasjkdhfkajshdfkjhasdkfjhetc";

bingContainer.Credentials = new NetworkCredential(accountKey, accountKey);

// Build the query:
// Example says "var webQuery = .... I just tried this
DataServiceQuery<WebResult> webQuery = bingContainer.Web("Testing", null, null, null, null, null, null, null);

// This returns a 403
// Example says "var results = .... I just tried this too...
IEnumerable<WebResult> results = webQuery.Execute();

我也尝试过:

bingContainer.IgnoreMissingProperties = true;

...不过这没什么区别...

谢谢。

【问题讨论】:

  • 错误是什么?什么不是“工作”?也许您需要一个有效的帐户密钥。
  • 请不要在问题标题中包含有关所用语言的信息,除非没有它就没有意义。标记用于此目的。

标签: c# bing-api


【解决方案1】:

您是否已订阅使用 bing api ?请检查以下链接并根据您的要求订阅

https://datamarket.azure.com/dataset/5BA839F1-12CE-4CCE-BF57-A49D98D29A44

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-26
    • 1970-01-01
    • 1970-01-01
    • 2017-02-19
    • 1970-01-01
    • 2012-12-28
    • 2017-04-21
    • 1970-01-01
    相关资源
    最近更新 更多