ProgrammerJon
Feb 12th, 2003, 10:08 AM
I have this code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' make a reference to a directory
Dim di As New IO.DirectoryInfo("c:\")
Dim diar1 As IO.FileInfo() = di.GetFiles("test.txt")
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
ListBox1.Items.Add(dra)
Next
End Sub
If I want to filter the search then I change di.GetFiles("righ here")
What do I do if I want to search for something similar to something.
ex.
If I wanted to search for files containg the word "Test" then what would I do?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' make a reference to a directory
Dim di As New IO.DirectoryInfo("c:\")
Dim diar1 As IO.FileInfo() = di.GetFiles("test.txt")
Dim dra As IO.FileInfo
'list the names of all files in the specified directory
For Each dra In diar1
ListBox1.Items.Add(dra)
Next
End Sub
If I want to filter the search then I change di.GetFiles("righ here")
What do I do if I want to search for something similar to something.
ex.
If I wanted to search for files containg the word "Test" then what would I do?