I have been browsing all over and I can't seem to find any answers that relate to me specifically.
I'm trying to either return an array of files or count files in a folder based off multiple conditions.
Something similar to this: how search file with multiple criteria of extension of file
However, I'm not looking to search based of file extension only but also file names.
For example:
If I have the following files in a folder:
test1.mp3
test2.avi
test1.jpg
How can I search for all files containing "1". The trick is that users can dynamically add conditions to check for in the file name. So it can't be something like this: dInfo.GetFilesByExtensions(".jpg",".exe",".gif");
The conditions will be added to an array of conditions.
So if the user now also searches for files containing "1" and "t". I would like it to return either "2" (so as a count) or as an array of these files for example, x being the code.
string[] files = x
after the code executes, the files array will look like this:
files[0] = "C:\test1.mp3"; files[1] = "C:\test1.jpg";