Results 1 to 2 of 2

Thread: Stream Reading code help needed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2008
    Posts
    95

    Stream Reading code help needed

    Hi
    I am trying to get data from a website.. by following code
    Dim Url As String = "http://www.awebsite.com"
    Code:
            ' Create the request.
            Dim PageRequest As HttpWebRequest = _
              CType(WebRequest.Create(Url), HttpWebRequest)
    
            ' Get the response.
            ' This takes the most significant amount of time, particularly
            ' if the file is large, because the whole response is retrieved.
            Dim PageResponse As WebResponse = PageRequest.GetResponse()
    
            ' Read the response stream.
            Dim r As New StreamReader(PageResponse.GetResponseStream())
            Dim Page As String = r.ReadToEnd()
            r.Close()
    what it does is stroe the whole content in a single string
    what i want instead of using readtoend() can i use something which will read line by line..

    with do loop?

    please hlep

  2. #2
    Frenzied Member obi1kenobi's Avatar
    Join Date
    Aug 2007
    Posts
    1,091

    Re: Stream Reading code help needed

    How about the ReadLine method? At least try looking in intellisense or MSDN or across the forums, before posting a question that has been answered 10 million times...
    Please rate helpful ppl's posts. It's the best 'thank you' you can give

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