消费RSS 1.0(RDF)饲料在ASP.NET MVC 3 [英] Consuming RSS 1.0 (RDF) Feeds in ASP.NET MVC 3
本文介绍了消费RSS 1.0(RDF)饲料在ASP.NET MVC 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何人都知道如何在ASP.NET MVC3使用RSS 1.0?
Can anyone know how to consume RSS 1.0 in ASP.NET MVC3?
推荐答案
我只想用这样的:
XDocument doc = XDocument.Load("URL to RSS Feed");
然后你就可以查询使用LINQ到XML这样的...
And then you can query using Linq to XML like this...
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)
};
这篇关于消费RSS 1.0(RDF)饲料在ASP.NET MVC 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文