Bing API“.Count”财产不工作?
我一直在尝试使用 Bing API 返回 20 个图像结果。代码如下:
SearchRequest request = new SearchRequest();
request.AppId = APPID;
request.Query = HttpUtility.HtmlEncode(searchQuery);
request.Sources = new SourceType[] { SourceType.Image };
request.Image = new ImageRequest();
request.Image.Count = 20;
request.Image.Filters = new string[1] { "Size:Medium" };
现在这里的所有内容都可以工作,包括 Image.Filters 属性。只是不是 Count 属性。是否存在已知的错误,或者我只是在这里遗漏了一些东西?
I have been trying to bring back 20 results of images using the Bing API. Here's the code:
SearchRequest request = new SearchRequest();
request.AppId = APPID;
request.Query = HttpUtility.HtmlEncode(searchQuery);
request.Sources = new SourceType[] { SourceType.Image };
request.Image = new ImageRequest();
request.Image.Count = 20;
request.Image.Filters = new string[1] { "Size:Medium" };
Now everything on here works, including the Image.Filters property. Just not the Count property. Is there a known bug or am I just missing something here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定这一点,但我认为您缺少设置 CountSpecified 属性。试试这个
I'm not sure really sure about this but I think you are missing setting
CountSpecified
property. Try this