Results 1 to 12 of 12

Thread: [RESOLVED] [2005] Reading Lines

Hybrid View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    7

    Re: [2005] Reading Lines

    This is my file:
    http://iat.awardspace.com/text.txt

    This is my code:
    VB Code:
    1. Private Sub btnGrab_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGrab.Click
    2.  
    3.         Dim externalPage() = Split(WebClient1.DownloadString("http://iat.awardspace.com/text.txt"), vbCrLf)
    4.  
    5.         For i As Integer = 0 To UBound(externalPage)
    6.             If externalPage(i).Contains("S") Then TextBox1.Text = TextBox1.Text & externalPage(i).ToString & vbNewLine
    7.         Next
    8.  
    9.     End Sub

    And this is what happens when I execute it:

  2. #2
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Reading Lines

    If you had put a messagebox after the split command you would realise that it's not splitting the file by vbCrLf.

    It should be this:

    VB Code:
    1. Dim externalPage() As String = webClient1.DownloadString("http://iat.awardspace.com/text.txt").Split(Chr(10))
    Last edited by stimbo; Jan 28th, 2007 at 02:50 PM.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

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