Filter DirectoryInfo File List retrieved?

  • Thread starter Thread starter Steve
  • Start date Start date
S

Steve

Hi,

I want to get a list of files in a directory, but I want
to filter the list to *.vb, for example. If I use a
straight forward

Directory.GetFileSystemEntries(path, "*.vb")

I get the filenames but also the path. I can use FileInfo
with DirectoryInfo to just get the Filenames, but I get
all the files in the selected directory. Is it possible
to filter the file list retrieved by DirectoryInfo? Or is
it possible to retrieve only the File Name using

Directory.GetFileSystemEntries

without having to parse?

Thanks,
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top