Can you call Directory.GetFiles() with multiple filters?

前端 未结 26 2766
逝去的感伤
逝去的感伤 2020-11-22 05:25

I am trying to use the Directory.GetFiles() method to retrieve a list of files of multiple types, such as mp3\'s and jpg\'s. I have t

26条回答
  •  渐次进展
    2020-11-22 06:04

    Nop... I believe you have to make as many calls as the file types you want.

    I would create a function myself taking an array on strings with the extensions I need and then iterate on that array making all the necessary calls. That function would return a generic list of the files matching the extensions I'd sent.

    Hope it helps.

提交回复
热议问题