Results 1 to 2 of 2

Thread: [02/03] Reead & Load file from URL to IO.Stream

  1. #1

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    Resolved [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

    Cheers,
    W
    Last edited by wrack; Aug 2nd, 2007 at 10:22 PM.

  2. #2

    Thread Starter
    ^:^...ANGEL...^:^ wrack's Avatar
    Join Date
    Mar 2002
    Location
    Melbourne, AUSTRALIA
    Posts
    2,695

    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:
    1. Dim wr As System.Net.WebRequest
    2.  
    3.         Try
    4.             wr = System.Net.WebRequest.Create(GlobalSettings.SportalLatestNewsFeed)
    5.             wr.Timeout = 5000 'Milliseconds
    6.             RssDocument = New System.Xml.XmlDocument
    7.  
    8.             RssDocument.Load(wr.GetResponse().GetResponseStream())
    9.         Catch ex As Exception
    10.             RssDocument = Nothing
    11.         Finally
    12.             wr.Abort()
    13.         End Try

    Hope this helps someone.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width