I thought I would start a new thread to clean up a little bit. It's too confusing. I've got code now that takes the first three characters of each line and lists it in a listbox. But...

How do I put each line into an array? The suggestions Edenis suggested in the other thread don't work (Add and ToArray are not members of System.Array)

Any suggestions are appreciated! Here is my code...

VB Code:
  1. Private strIDNumbers As ArrayList()
  2.     Private intRecordcount As Integer = 0
  3.  
  4.     Private Sub OpenFileButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileButton.Click
  5.         'determine if customers.txt exists
  6.         If System.IO.File.Exists("customers.txt") = True Then
  7.             'make the property labels visible
  8.             Me.IDNumberLabel.Visible = True
  9.             Me.NameLabel.Visible = True
  10.             Me.CreditLimitLabel.Visible = True
  11.             Me.BalanceDueLabel.Visible = True
  12.             'open the text file
  13.             Dim objStreamReader As System.IO.StreamReader
  14.             Dim strLine As String
  15.             objStreamReader = System.IO.File.OpenText("customers.txt")
  16.             Do While objStreamReader.Read
  17.                 strLine = objStreamReader.ReadLine
  18.  
  19.                 Dim strID As String, intLength As Integer
  20.                 intLength = Val(strLine.Length)
  21.                 strID = strLine.Remove(3, (intLength - 3))
  22.                 Me.IDListBox.Items.Add(strID)
  23.                 intRecordcount = intRecordcount + 1
  24.             Loop
  25.             Me.OpenFileButton.Enabled = False
  26.             'customers.txt does not exist, stop
  27.         Else
  28.                 MessageBox.Show("File does not exist!", "File not found", _
  29.                 MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  30.  
  31.         End If
  32.     End Sub