How do I do System.IO.Directory.GetFiles("*.tif") and System.IO.Directory.GetFiles("*.jpg") in the same call?
How do I do System.IO.Directory.GetFiles(*.tif) and System.IO.Directory.GetFiles(*.jpg) in the same call?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The most efficient way I believe (scanning the directory only once, and yielding results without first building up the whole list) is like this:
Of course, if you need to loop over the results more than once it’s probably best to store the result in a list anyway.