How to recursively list all the files in a directory in C#?

前端 未结 22 2395
长发绾君心
长发绾君心 2020-11-22 00:07

How to recursively list all the files in a directory and child directories in C#?

22条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 00:54

    Shortest record

    string files = Directory.GetFiles(@"your_path", "*.jpg", SearchOption.AllDirectories);
    

提交回复
热议问题