By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,061 Members | 1,539 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,061 IT Pros & Developers. It's quick & easy.

Filter DirectoryInfo File List retrieved?

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Nevermind. I figured it out. Put the filter
in ...GetFiles(filter)

Silly post.
--
---Original Message-----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 FileInfowith 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 isit possible to retrieve only the File Name using

Directory.GetFileSystemEntries

without having to parse?

Thanks,
Steve
.

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.