Option Strict On
Imports Microsoft.VisualBasic.FileIO
Imports System.Collections.ObjectModel
Public Module FileFind
Public Sub Main()
Dim filespec() As String = {"*.vb"}
Dim matches As ReadOnlyCollection(Of String)
matches = My.Computer.FileSystem.FindInFiles(".", "Class", False,SearchOption.SearchTopLevelO
nly, filespec)
If matches.Count > 0 Then
Console.WriteLine("'Class' found in:")
For Each filename As String In matches
Console.WriteLine(" " & filename)
Next
Else
Console.WriteLine("No matches found.")
End If
End Sub
End Module
'Class' found in:
C:\Java_Dev\WEB\dev\VB\Addaprinterprocess.vb
C:\Java_Dev\WEB\dev\VB\Addfirstpointandsizetoanotherpoint.vb