如何在WPF中阅读Atom Feed Xml

时间:2013-10-30 14:11:44

标签: c# .net xml wpf rss

上次我在这里发布了我的问题:How to read an Atom XAML File in WPF?。它与How to Read Atom Xaml有关。一个StackOverflow用户发布了有效的答案。但是如何阅读usernamepassword.xml没有扩展名的RSS / Feed?

此处代码为:

 XmlReader reader = XmlReader.Create(@"http://link1/myxaml.xml");
SyndicationFeed feed = SyndicationFeed.Load(reader);
var titles = from item in feed.Items
            select new
                {
                item.Title.Text,  
                 };
var descriptions = from item in feed.Items
        select new
            {   
            item.Summary.Text

             };

foreach (var t in titles)
 {
title_textbox.Text += t.Text + "  ";             //Your All Titles Here

 }
foreach (var des in descriptions)
 {
description_textbox.Text += des.Text + "  ";     //Your All Descriptions Here  
 }

注意:我正在使用WPF(C#)

1 个答案:

答案 0 :(得分:0)

请参阅此链接:http://www.codeproject.com/Articles/94794/XML-Binding-in-WPF-with-Sample-RSS-Reader

这是关于WPF中的XML绑定和示例RSS阅读器