Click here to Skip to main content
11,478,896 members (74,641 online)
Click here to Skip to main content

Quick RSS

, 14 Mar 2013 CPOL 5K 3
Rate this:
Please Sign up or sign in to vote.
Quick way to read RSS

Introduction

In .NET 3.5, the class SyndicationFeed was introduced. We can use that to read/create RSS2 and Atom 1.0 feeds. In this tip, the class is used to develop a RSS reader.

Using the Code

Import System.Xml and  System.ServiceModel.Syndication in your RSS Reader class. 

Dim feedurl As String = "http://feeds.feedburner.com/cnet/NnTv"
Dim reader As XmlReader = XmlReader.Create(feedurl)
Dim feed As SyndicationFeed = SyndicationFeed.Load(reader)

txtFeed.Text = txtFeed.Text & vbCrLf & feed.Title.Text

For Each item As SyndicationItem In feed.Items
    txtFeed.Text = txtFeed.Text & vbCrLf & item.Title.Text
Next  

The above code shows a simple implementation. txtFeed is a text box where the details of the feed are displayed.

The same definitions work for C#. 

Reference

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Anshul R
Student
India India
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 14 Mar 2013
Article Copyright 2013 by Anshul R
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid