从BBC的RSS天气预报中下载时,我会在随机的场合看到奇怪的文本/数据。奇怪的是,如果我直接从网络加载而不是下载,就会发生这种情况。这可能是记忆问题吗?它是随机的,但70%的时间,其中一个位置将被下载错误。
下载子资料:
Public Sub DownloadWeather()
If IsConnectionAvailable() = True Then
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2657832/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Aberdeen.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2656752/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Aviemore.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2653609/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Barra.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2650752/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Dundee.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2650798/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Dumfries.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2651245/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Dingwall.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2650225/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Edinburgh.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2648579/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Glasgow.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2636239/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Harris.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2646088/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Inverness.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2655051/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Islay.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2636790/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Lewis.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2635754/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Mull.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2641108/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Oban.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2645198/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Orkney.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2640358/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Perth.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2644605/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Shetland.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2640006/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Skye.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2635881/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Thurso.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2643811/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Uist.rss")
Module_XML_Download.DownloadXML("http://open.live.bbc.co.uk/weather/feeds/en/2635199/3dayforecast.rss", My.Settings.DataMainFolder & "\" & My.Settings.DataWeatherXMLFolder & "\Ullapool.rss")
End If
End Sub
Public Sub DownloadXML(ByVal URL As String, ByVal SaveAs As String)
Try
Dim WebClient As New System.Net.WebClient()
WebClient.DownloadFile(URL, SaveAs)
If My.Settings.LogXMLDownloaded = True Then
Module_Log.WriteLog(Now.ToString & " XML Downloaded: " & SaveAs)
End If
Catch _Exception As Exception
' Error
' MsgBox("Exception caught in process: {0}", _Exception.ToString())
If My.Settings.LogXMLDownloadError = True Then
Module_Log.WriteLog(Now.ToString & " XML DL Error: " & _Exception.Message)
End If
End Try
End Sub
在某些location.rss文件中随机出现的奇怪垃圾数据:
‹ Í–áNÛ:Ç¿OÚ;EºÒ¦µ±“ÚEiÑ…‰Mº Mƒ±ÈMÜÆ"±#Û¡ë[íöd÷8MK i_šÄ>>ÿÿ9þ9Mzð³*ášk#”œxO=à2S¹‹‰÷ýüx8ö¦oߤÚÀPifU5ñ
kë“åré/#_é”É¿8éu®pÕÐõP¾¾õn'CÔF%€4 +〜“¼lðÑ&¥WPh>ßæS5-~)®¹?> e~ |ææ,9³×dÎyn-$ÜßÇ£ ÊÙj®4Ï〜±〜««y9ñ/çØUÍ'«ëRdÌ¢,°ÈÆ“¶äÓÃÃ#ø±Ö€!w 3 |。™Y?¾KayÿasU¥d½'Ëãê~ö:²ë½³œ'6'[-s “IQ的sÓhÅÀ¼/硫杂\«
ž&安培; dV6n7a¹²¼ª¹f¶Ñ~Ìa)ðGHÌSμÕ§¤¯¶ñÍä¢A>å8¿} E&安培;3U¯'Xvz'¹KàÝÑ{80A的
秀±Ü¹uFŽ”®•ñ¥8‡{Ûa¹®ay.\ +/8¦°ˆ««¸Âò!ç–‰Ò¤äÆ@ç¨nfŸ˜åÓc-P8ÅŽ…4ˆ ’
”!| ¥)ÙvëDuSÖËí:fjt¹Ùvc±OI•* IL = O#¤i]“2%ñWæâZä
¶]®Ç¸¼Tò²t_Îýý...~§Ä‰l.G。\ŠÜÓa'õÝv¢àm<ÝLwÛuôÛ-bª»-Ä} @h8qËà¸õ§ì§¨š
ÎoxLp~ÿ:,wqøû×ñ{8r7d¿Ø<\ÄNŸŸ\ú»Ð»μ÷ÉÜàqƒøáŽ×'и¬œ©ÆÈ“AÂËU7VãËe¯êb™(...ÅŽ]p½,ÏJåøª¹1k”Õl_šJämØhü2xß“¹J U–ÍZñÄñyÖH-®¥qÄpxvÞŽŽG5ÄC¹¡ûŽþóO®\4ß-æ+fv‚žxsVî=i‹†tèT†4ô|£åSJQ.qz.}O¬ýKIj%¤Æ±?Þ±ÒážÆ£ý(%·æ·èÞÐz/¹gnSŸÈ.]³Afw´F#~vƒ?g·ïïvûwÙ}€ÚøÙÔî÷©
¡6Ú¥6þ©
þjùbÌîµÑÇ
6 |fûÿð} I {'ãÛÐŽ£&GT;'A#d»DZZ毫安
^Úð'ÖkA
答案 0 :(得分:1)
我刚从网站上的代码请求BBC Weather RSS feed时,第一次看到同样的事情。
我刚刚将使用BBC Feed的网站添加到CloudFlare,但我看不出这可能与之相关。
我在BBC RSS提要网址的末尾添加了一个随机查询字符串,因此我的网址如下所示:
http://open.live.bbc.co.uk/weather/feeds/en/2634135/3dayforecast.rss?123
问题立即得到解决。
请注意,如果我直接在自己的浏览器中手动请求了Feed,那么它运行正常。