|
namespace working_on_rss
{
public class create_rss2_sample1 : System.Web.UI.Page
{
#region Web Form Designer generated code
override protected void OnInit(System.EventArgs e)
{
InitializeComponent();
base.OnInit(e);
}
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Page_Load(object sender, System.EventArgs e)
{
IranianExperts.RSS.RSSChannel oRSSChannel = new IranianExperts.RSS.RSSChannel("Channel Title", "Channel Link", "Channel Description");
oRSSChannel.PubDate = System.DateTime.Now.ToString();
IranianExperts.RSS.RSSRoot oRSSRoot = new IranianExperts.RSS.RSSRoot(oRSSChannel, Response.OutputStream);
IranianExperts.RSS.RSSItem oRSSItem = null;
oRSSItem = new IranianExperts.RSS.RSSItem("Item 1", "http://www.Item1.com");
oRSSItem.PubDate = System.DateTime.Now.ToString();
oRSSRoot.Items.Add(oRSSItem);
oRSSRoot.Items.Add("Item 2");
oRSSRoot.Items.Add("Item 3", "http://www.Item3.com");
Response.Clear();
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.ContentType = "text/xml";
IranianExperts.RSS.RSSUtilities.PublishRSS(oRSSRoot);
Response.End();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.