LocationMy.Computer.FileSystem.FindInFiles SyntaxDim result As System.Collections.ObjectModel.ReadOnlyCollection( _ Of String) = My.Computer.FileSystem.FindInFiles(path, _ containsText, ignoreCase, searchType[, wildcard])
DescriptionThe FindInFiles method returns a collection of strings, each one the name of a file within the specified directory that includes the specified search text. The set of files to search may be limited using the wildcard parameter. If no searched files include the specified search text, an empty collection is returned. Usage at a Glance
ExampleThe following statement searches for files that contain the text "virus" (independent of case) in the current user's MyDocuments folder, ignoring any subdirectories. Dim result As System.Collections.ObjectModel.ReadOnlyCollection( _ Of String) = My.Computer.FileSystem.FindInFiles( _ My.Computer.FileSystem.SpecialDirectories.MyDocuments, _ "VIRUS", True, FileIO.SearchOption.SearchTopLevelOnly) Related Framework Entries
See AlsoCurrentDirectory Property, Drives Property, FileSystem Object, GetDirectories Method, GetDirectoryInfo Method, GetDriveInfo Method, GetFileInfo Method, GetFiles Method, GetTempFileName Method |