Q:

Trying to read from a .txt file to populate a ListBox and Label

So far I have this, though I am missing something. I'm supposed to use an array to populate the list box with items from the .txt, then when an item in the list box is clicked, the label updates with a price. Any suggestions?
Public Class frmMain

Structure product
    Public itemnumber As String
    Public itemprice As Decimal
End Structure

Private Sub ButtonExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonExit.Click
    Me.Close()
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim ItemInfo As String = "H:\Users\user\Documents\Visual Studio 2012\Projects\WindowsApplication9\ItemInfo.txt"
    Dim inFile As IO.StreamReader
    Dim strName As String
    Dim skipLine As Boolean

    If System.IO.File.Exists("H:\Users\user\Documents\Visual Studio 2012\Projects\WindowsApplication9\ItemInfo.txt") = True Then
        inFile = IO.File.OpenText("H:\Users\user\Documents\Visual Studio 2012\Projects\WindowsApplication9\ItemInfo.txt")
        Do Until inFile.Peek = -1
            strName = inFile.ReadLine
            If skipLine = False Then
                ListBox1.Items.Add(strName)
                skipLine = True
            Else : skipLine = False
            End If
        Loop

        Dim objReader As New System.IO.StreamReader(ItemInfo)
        ListBox1.Text = objReader.ReadToEnd
        objReader.Close()
    Else

        MsgBox("File Does Not Exist")

    End If
End Sub

End Class

A:

Here is a big hint:
Imports System.IO
Public Class Form1

    Dim myItems As List(Of Product)
    Class Product
        Public ItemNumber As String
        Public ItemPrice As Decimal
    End Class

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim itemInfo As String = "H:\Users\user\Documents\Visual Studio 2012\Projects\WindowsApplication9\ItemInfo.txt"

        If File.Exists(itemInfo) Then
            myItems = New List(Of Product)
            Dim allItems = File.ReadAllLines(itemInfo)

            For Each line As String In allItems

                ' see http://msdn.microsoft.com/en-us/library/ms131448%28v=vs.110%29.aspx for String.Split
                Dim parts() As String = line.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)
                ' only process lines with two parts
                If parts.Count = 2 Then
                    Dim itemEntry As New Product
                    itemEntry.ItemNumber = parts(0)
                    'TODO: (optional) use Decimal.TryParse to make sure the entry really can be parsed as a Decimal.
                    itemEntry.ItemPrice = CDec(parts(1))
                    myItems.Add(itemEntry)
                End If

            Next

        Else
            'HINT: always give as much info as is reasonable when saying something went wrong.
            MsgBox("File """ & itemInfo & """ does not exist or could not be opened.")
        End If

        'TODO: show the items by getting the .ItemNumber of each item in myItems
    End Sub

End Class

