RSS Feeds in a vb.net desktop application…

Ok so i thought it would be a good idea to write an RSS feed reading into the project that im currently working on.

Based on this i found the following code:


Public Shared Function ProcessRSS(ByVal rssURL As String, ByVal feed As String) As String
Dim request As WebRequest = WebRequest.Create(rssURL)
Dim response As WebResponse = request.GetResponse()
Dim sb As New StringBuilder("")
Dim rssStream As Stream = response.GetResponseStream()
Dim rssDoc As New XmlDocument()
rssDoc.Load(rssStream)
Dim rssItems As XmlNodeList = rssDoc.SelectNodes("rss/channel/item")
Dim title As String = ""
Dim link As String = ""
Dim upperlimit As Integer = rssItems.Count
If upperlimit > 5 Then
upperlimit = 5
End If
If upperlimit > 0 Then
sb.Append("" + feed + "

    ")
    Dim i As Integer = 0
    While i < upperlimit
    Dim rssDetail As XmlNode
    rssDetail = rssItems.Item(i).SelectSingleNode("title")
    If Not IsNothing(rssDetail) Then
    title = rssDetail.InnerText
    Else
    title = ""
    End If

rssDetail = rssItems.Item(i).SelectSingleNode("link")
If Not IsNothing(rssDetail) Then
link = rssDetail.InnerText
Else
link = ""
End If
sb.Append("

  • " + title + "
  • ")
    i += 1
    End While
    sb.Append("")
    End If
    Return sb.ToString()

    this is all good and seams to work.. except i needed to add a proxy logon:
    request.Proxy.Credentials = CredentialCache.DefaultCredentials

     

    This entry was posted on Wednesday, September 10th, 2008 at 10:37 am and is filed under IT, Code and other geeky stuff, Pete Matthews. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

    One Response to “RSS Feeds in a vb.net desktop application…”

    1. TROY Says:


      CheapTabletsOnline.com. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. Low price pills. Order pills online

      Buy:Benicar.Lipitor.Seroquel.Zetia.Lasix.Lipothin.Buspar.SleepWell.Cozaar.Aricept.Acomplia.Nymphomax.Advair.Prozac.Zocor.Wellbutrin SR.Female Pink Viagra.Ventolin.Female Cialis.Amoxicillin….

    Leave a Reply

    You must be logged in to post a comment.