List all files and directories in a directory + subdirectories

前端 未结 15 1909
陌清茗
陌清茗 2020-12-13 01:46

I want to list every file and directory contained in a directory and subdirectories of that directory. If I chose C:\\ as the directory, the program would get every name of

15条回答
  •  孤城傲影
    2020-12-13 02:21

    Use the GetDirectories and GetFiles methods to get the folders and files.

    Use the SearchOption AllDirectories to get the folders and files in the subfolders also.

提交回复
热议问题