Dim cartella As New System.IO.DirectoryInfo("C:\")
Dim listaFile() As System.IO.FileInfo = cartella.GetFiles("*.txt", IO.SearchOption.TopDirectoryOnly)
If listaFile.Length > 0 Then
MsgBox("Sono stati trovati " & listaFile.Length.ToString & " file txt!")
Else
MsgBox("Non sono stati trovati file txt!")
End If