I am using the code below to get a list of files from multiple folder paths. Now I want to query that list to see if a specified file name exists. I don't want to loop through the list one file at a time, but rather use something like LINQ, but I'm not sure how to do it. I'm hoping someone can help me out. Thanks...
Code:Dim allFiles As New List(Of IO.FileInfo) Dim files As IO.FileInfo() files = New IO.DirectoryInfo(folderPath1).GetFiles("*") allFiles.AddRange(files) files = New IO.DirectoryInfo(folderPath2).GetFiles("*") allFiles.AddRange(files) files = New IO.DirectoryInfo(folderPath3).GetFiles("*", IO.SearchOption.AllDirectories) allFiles.AddRange(files)




Reply With Quote
