How to use Directory.GetFiles to get only gif types (or any other type)?

前端 未结 2 1407
太阳男子
太阳男子 2021-01-26 17:20

I\'m trying to filter files by extension (in particular case \".gif\") but GetFiles method for some reason does not find any files (even if there are definitely fil

2条回答
  •  攒了一身酷
    2021-01-26 17:45

    Use the search pattern overload on GetFiles:

    System.IO.Directory.GetFiles(@"C:\Windows", "*.gif");
    

提交回复
热议问题