[02/03] Reead & Load file from URL to IO.Stream
Hi,
Is it possible to read & load an XML file (example: http://sportal.com.au/rss/Australia/Latest.xml) directly to XML Document or to a IO.Stream without download it?
If yes then can someone please shed some light on it by a quick example?
I am sure I have done this before but have lost the code and in need of a quick fix :D
Cheers,
W
Re: [02/03] Reead & Load file from URL to IO.Stream
OK, after playing few hand balls with it I have found it.
Here is the code.
vb Code:
Dim wr As System.Net.WebRequest
Try
wr = System.Net.WebRequest.Create(GlobalSettings.SportalLatestNewsFeed)
wr.Timeout = 5000 'Milliseconds
RssDocument = New System.Xml.XmlDocument
RssDocument.Load(wr.GetResponse().GetResponseStream())
Catch ex As Exception
RssDocument = Nothing
Finally
wr.Abort()
End Try
Hope this helps someone.