I want to search a directory and get the list of all jpg files. The code that I have is as follow:
string fileList = Directory.Exists(this._imageDirectory)
? Directory.GetFiles(this._imageDirectory, "*.jpg")
This is working well if I have files such as below:
In the above case it finds only two files. But if I have the following files:
it finds 3 files. It finds 3.jpg_tmp which it should not find it.
How can I fix it without looking into all fileList and finding the ones that are not correct?