I need to get a list of filenames in a directory with a certain pattern. The files are named fileX.dat where X = a 1 or 2 digit number.
So for example, they could be called file1.dat or file10.dat. I can get just the single digit files like this:
I would like to get both the single & double digit files in one line of code. Can anyone help me out? Thanks...
So for example, they could be called file1.dat or file10.dat. I can get just the single digit files like this:
Code:
Dim files() As String = (From file In New IO.DirectoryInfo(usePath).GetFiles Order By file.Name Where file.Name Like myFileName & "?" & myFileExt Select file.FullName).ToArray