Public Class Form1 Dim FileCount As Integer = 0 Private Sub BtnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearch.Click If Not CombxDrive.Text = Nothing Then ListBox1.Items.Clear() FileCount = 0 End If For Each File In My.Computer.FileSystem.GetFiles(CombxDrive.Text, FileIO.SearchOption.SearchAllSubDirectories, Nothing) Dim Title As String = My.Computer.FileSystem.GetFileInfo(File).Name If Title.Contains(CombxDrive.Text) Then ListBox1.Items.Add(Title) FileCount = FileCount + 1 End If Next LblFileFound.Text = FileCount And "FilesFound" End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)