Hi I am trying to retrieve news(Bing Search API) from a 1 of the 8 categories Bing offers.
Check Documentation Here.
According to the documentation it should take in a string with one of the values listed in the page above. But everytime I apply it:
request.Query = "Football";
request.Sources = new SourceType[] { SourceType.News };
request.News.Category =开发者_JAVA技巧 "rt_ScienceAndTechnology";//Error comes here
This returns a "null reference exception". Any replies and suggestions would be greatly appreciated.
I think you need to initialise request.News before setting Request.News.Category like this
request.News = new NewsRequest();
taken from here: http://msdn.microsoft.com/en-us/library/dd251024.aspx
精彩评论