Forbidden Error In Visual Basic


  • Hello, I have a program that gets weather alerts from the national weather service rss feed. It has worked great. Recently, it has been giving me forbidden errors in the program, but when I enter the URL I get the alerts from into a web browser, it displays the feed. Why is it giving me this and how can I fix?

    Here is the code:

    Using WB As New WebClient
                    Dim WXData As String = WB.DownloadString("My.Settings.NWS_Alert")
                    If WXData <> LastWXData Then
                        LastWXData = WXData
                        ListBox1.Enabled = False
                        Dim TitleList As XmlNodeList = XmlDoc.GetElementsByTagName("description")
                        Dim SummaryList As XmlNodeList = XmlDoc.GetElementsByTagName("message")
                        For i = 1 To TitleList.Count - 1
                            WXDict.Add(TitleList(i).InnerText, SummaryList(i - 1).InnerText)
                        Label6.Text = SummaryList(0).InnerText
                        ListBox1.Enabled = True
                        ListBox1.SelectedIndex = 0
                    End If
                Catch ex As Exception
                End Try
            End Using
        End Sub
        Dim LastWXData As String = ""

    In the first section, the link is typed into a textbox and is saved in My.Settings.NWS_Alert. Then another textbox (that is hidden) displays the link and the program grabs the information from the RSS Feed. Note: This feeds can be found at under the atom icons next to the states or click counties for individual counties.


    Wednesday, March 22, 2017 11:21 PM

All replies