Click here to Skip to main content
12,632,417 members (30,054 online)
Click here to Skip to main content
Add your own
alternative version

Stats

5.9K views
3 bookmarked
Posted

Quick RSS

, 14 Mar 2013 CPOL
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

You may also be interested in...

Comments and Discussions

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