File System: Find In Files : File System « File Directory « VB.Net






File System: Find In Files

Imports System
Imports System.Collections.ObjectModel
Imports System.IO

Public Class MainClass

   Shared Sub Main()
        Dim file_names As ReadOnlyCollection(Of String)
        Dim directory As String = "c:\"
        Dim searchFor As String = "windows"
        
        file_names = My.Computer.FileSystem.FindInFiles( _
            directory, _
            searchFor, _
            True, _
            FileIO.SearchOption.SearchAllSubDirectories)

        For Each file_name As String In file_names
            Console.WriteLine( file_name )
        Next file_name
   End Sub 

End Class

           
       








Related examples in the same category

1.Combine Path
2.Read Text file contentRead Text file content