This is my question:
Write a program with a text box, and button, and list box. The user is to place a pathname in the text box and click the button. The program should first check that the file exists, displaying a message box if it doesn’t. If it does, the program should read the file as a text, with one string per line, and place each string as a new item in the list box.

Here is the code I have so far,when I run it i think it gives the error message correctly, but it gives me an error and then doesn't put the file names into the list. could someone help me out with this?? What am I doing wrong?:

VB Code:
  1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  2.         Dim sFileToCheck As String = TextBox.Text
  3.         Dim sFileList() As String
  4.  
  5.         If File.Exists(sFileToCheck) Then
  6.             sFileList = Directory.GetFiles(TextBox.Text)
  7.             ListBox1.Items.AddRange(sFileList)
  8.         Else
  9.             MessageBox.Show("The file does not exist")
  10.         End If
  11.  
  12.     End Sub
  13. End Class