有谁知道如何在ASP.NET MVC3中使用RSS 1.0?
答案 0 :(得分:2)
我会用这个:
XDocument doc = XDocument.Load(“URL to RSS Feed”);
然后你可以像这样使用Linq查询XML ...
var query = from feed in doc.Descendants(“item”)
orderby DateTime.Parse(feed.Element(“pubDate”).Value) descending
select new
{
Title = feed.Element(“title”).Value,
Description = feed.Element(“description”).Value,
Date = DateTime.Parse(feed.Element(“pubDate”).Value)
};