All you need to do get a list of FileInfo instead of filenames is create a new FileInfo for each file, like this:
Private Function Get_Files(ByVal rootDirectory As String, ByVal recursive As Boolean, ParamArray exts() As String) As List(Of IO.FileInfo)
Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly)
Return IO.Directory.GetFiles(rootDirectory, "*.*", searchOpt).Where(Function(o) exts.Contains(IO.Path.GetExtension(o))).Select(Function(p) New IO.FileInfo(p)).ToList
End Function
And if you use Imports System.IO
at the top of your code, you don't need to type IO.
so much and it will look tidier.
EDIT:
For a case-sensitive test of the extension, you could implement the comparer in the Enumerable.Contains method:
Public Class FilenameExtensionComparer
Implements IEqualityComparer(Of String)
Public Function Equals1(s As String, t As String) As Boolean Implements IEqualityComparer(Of String).Equals
Return String.Compare(s, t, StringComparison.OrdinalIgnoreCase) = 0
End Function
Public Function GetHashCode1(s As String) As Integer Implements IEqualityComparer(Of String).GetHashCode
Return s.GetHashCode()
End Function
End Class
Private Function Get_Files(ByVal rootDirectory As String, ByVal recursive As Boolean, ParamArray exts() As String) As List(Of IO.FileInfo)
Dim searchOpt As IO.SearchOption = If(recursive, IO.SearchOption.AllDirectories, IO.SearchOption.TopDirectoryOnly)
Dim filenameExtComparer As New FilenameExtensionComparer
Return IO.Directory.GetFiles(rootDirectory, "*.*", searchOpt).Where(Function(o) exts.Contains(IO.Path.GetExtension(o), filenameExtComparer)).Select(Function(p) New IO.FileInfo(p)).ToList
End Function
I sense feature-creep in this question ;) You should have a look at the documentation for the .NET methods which are used and see if they have overloads which are useful to you.
EDIT 2: Oops, I see you wanted case-insensitivity. I adjusted the comparer appropriately.