我只是想在这里解析一个 RSS 提要,我可以用 XmlReader 做到这一点
String blogrss = @"http://belvederecollegeac.wordpress.com/feed/";
using (System.Xml.XmlReader reader = System.Xml.XmlReader.Create(blogrss))
{
System.ServiceModel.Syndication.SyndicationFeed feed = System.ServiceModel.Syndication.SyndicationFeed.Load(reader);
foreach (var v in feed.Items)
{
string title = v.Title.Text.Replace("•", " --- ");
string url = v.Id;
string link = "<a href=" + url + ">" + title + "</a>";
Response.Write(link + "<br><br>");
}
但我找不到 xml 阅读器如何给我描述节点?
我可以得到 v.Tite 和 v.Id (用于链接),但 RSS 包含一个描述节点,例如这个
<description>
<![CDATA[
Photos from the J.C.T. game v Kilkenny College can be viewed at the College website gallery page. A highlights video from the S.C.T. game v Terenure can also be viewed on the video gallery page.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=belvederecollegeac.wordpress.com&blog=41877065&post=92&subd=belvederecollegeac&ref=&feed=1" width="1" height="1" />
]]>
</description>
我的feed.Items
收藏似乎没有附加对象,称为描述?