Results 1 to 3 of 3

Thread: Read WEbpage into ARRAY

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    507

    Read WEbpage into ARRAY

    I need to read a WEb page and put each line into an Array in Vb .net

    any help is well appreciated.

    Thanks

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Read WEbpage into ARRAY

    Try this:
    Code:
    Using client = New Net.WebClient()
    
        '//the web page to download
        Dim source = client.DownloadString("http://www.google/com")
        If Not String.IsNullOrEmpty(source) Then
    
            '//split the source on each new line
            Dim lines = source.Split(New String() {Environment.NewLine}, _
                                     StringSplitOptions.None)
            For Each line In lines
                '//do something
            Next
        End If
    End Using

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Posts
    507

    Re: Read WEbpage into ARRAY

    that didn't work, a page of 538 lines was read in an array with this method for only 14 lines.

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