hi, this is my problems:
i have a text file contains " staff id, male/female, first name+surname", which look like this:
i have 2 problems:
1: i dont know how to display a error message if the text file is not found.
(i can display all the staff's in listbox with one click)
2: i need to display "male" only in the listbox.
can anyone help me?
this is the code i'm using to display all staff members, but couldn't show the error msg if file is not found.
Private Sub displaynames_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles displaynames.Click ListBox1.Items.Clear() Dim Members As String = "path" Dim rvSR As New IO.StreamReader(Members) Do While rvSR.Peek <> -1 ListBox1.Items.Add(rvSR.ReadLine()) Loop rvSR.Close() If Members = "" Then MessageBox.Show("No Text is found") End If End Sub