background preloader

RSS Reader

Facebook Twitter

Visual C# 2010 Tutorial - Rss Reader. Displaying RSS Items with C# and ASP.NET. I was looking for a quick and easy way to display RSS feeds on a Web page.

Displaying RSS Items with C# and ASP.NET

I choose to use C# and ASP.NET, thus my options were pretty open. I created a simple function within a script to process the RSS items from a URL for an RSS feed. You should be able to easily use this function or pull the code from it to use as your own. The function takes a string, rssURL, as its parameter. This string contains contains the RSS URL. System.Net.WebRequest myRequest = System.Net.WebRequest.Create(rssURL); The response of that request is then placed into a WebResponse object: System.Net.WebResponse myResponse = myRequest.GetResponse(); Next the WebResponse object is used to set up a stream to pull out the XML values: System.IO.Stream rssStream = myResponse.GetResponseStream(); This is followed by creating an XmlDocument object that can be used to hold the XML pulled from the stream created from the RSS URL. Visual C# 2010 Tutorial - Rss Reader. RSS feed reader implementation in C# Simple RSS Reader in C# Download source - 3.59 KB Introduction This is a simple way of reading an RSS from a feed using C# and XSL.

Simple RSS Reader in C#

Using the Code There are two major parts in this solution. One is the Page that requests and renders the feed and another one will be the XSL which transforms the XML feed. The first is the default.aspx.cs. Using System.Xml; using System.IO; using System.Net; Then let's go to the fun part: string xmlsrc = " string Password = "xxxxxx"; string UserAccount = "xxxxxx"; string DomainName = "xxxxxx"; string ProxyServer = "192.168.1.1:8080"; string xslsrc = "RSS91.xsl"; if (xmlsrc ! Then the XSL which formats the feed visually. History 7th August, 2007: Initial post. Creating an Online RSS News Aggregator with ASP.NET. Scott Mitchell Revised August 2003 Applies to: Microsoft® ASP.NET Summary: Learn about displaying XML data in an ASP.NET Web page using the XML Web control to retrieve remote XML data, and about using the Repeater control to emit XML data from a database.

Creating an Online RSS News Aggregator with ASP.NET

With the ever-increasing demands of data sharing among disparate platforms, the use of XML has exploded over the past few years. Realizing this trend, Microsoft made sure to include robust XML support throughout the .NET Framework. Download RSSAggregator.msi. Contents Introduction Syndicating Content with RSS 2.0 Creating the Syndication Output via an ASP.NET Web Page Consuming a Syndication Feed in an ASP.NET Web Page Displaying the List of Syndication Feeds Displaying the News Items for a Particular Syndication Feed Displaying the Details for a Particular News Item Future Enhancements and Current Shortcomings Summary Introduction A good example of data-sharing using XML is Web site syndication, commonly found in news sites and Web logs.