您可以使用LINQ来简化代码以加入两个列表(不要忘记将System.Linq放在您的使用中,如果需要,请在项目中引用System.Core)这是一个Main,它将联合并打印到控制台(带适当清理读者).
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml; using System.ServiceModel.Syndication; namespace FeedUnion { class Program { static void Main(string[] args) { Uri feedUri = new Uri("http://stackoverflow.com/feeds/tag/silverlight"); SyndicationFeed feed; SyndicationFeed feed2; using(XmlReader reader = XmlReader.Create(feedUri.AbsoluteUri)) { feed= SyndicationFeed.Load(reader); } Uri feed2Uri = new Uri("http://stackoverflow.com/feeds/tag/wpf"); using (XmlReader reader2 = XmlReader.Create(feed2Uri.AbsoluteUri)) { feed2 = SyndicationFeed.Load(reader2); } SyndicationFeed feed3 = new SyndicationFeed(feed.Items.Union(feed2.Items)); StringBuilder builder = new StringBuilder(); using (XmlWriter writer = XmlWriter.Create(builder)) { feed3.SaveAsRss20(writer); System.Console.Write(builder.ToString()); System.Console.Read(); } } } }