I have this code:
string[] files = Directory.GetFiles(path, "......", SearchOption.AllDirectories)
What I want is to return only files which do NOT start with p_ and t_ and have the extension png or jpg or gif. How would I do this?
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.
Directory.GetFilesdoesn’t supportRegExby default, what you can do is to filter byRegExon your file list. Take a look at this listing: