1: using RssToolkit.Rss;
2: using System.Collections.Generic;
3: using System.Xml;
4:
5: protected void Page_Load(object sender, EventArgs e)
6: {
7:
8: //Inicializando RSS
9: RssDocument meurss = new RssDocument();
10: RssChannel rss = new RssChannel();
11: rss.PubDate = System.DateTime.Now.ToString();
12: rss.Description = "RSS Ramones";
13: rss.Title = "Ramon's Rss";
14: meurss.Channel = rss;
15: meurss.Version = "2.0";
16:
17: meurss.Channel.Items = new List<RssItem>();
18:
19: //Adicionando itens
20: RssItem item = new RssItem();
21: item.Title = "Treinamento AJAX";
22: item.Description = "CD Treinamento Microsoft Ajax";
23: item.Link = "~/ajax.aspx";
24: meurss.Channel.Items.Add(item);
25:
26: item = new RssItem();
27: item.Title = "WorkShop Visual Studio Team System";
28: item.Description = "Treinamento VSTS";
29: item.Link = "~/vsts.aspx";
30: meurss.Channel.Items.Add(item);
31:
32:
33: //Retornando Stream xml
34: string outputXml = meurss.ToXml(DocumentType.Rss);
35: XmlDocument document = new XmlDocument();
36: document.LoadXml(outputXml);
37: Response.ContentType = "text/xml";
38: document.Save(Response.OutputStream);
39: Response.End();
40: }