List all files and directories in a directory + subdirectories

前端 未结 15 1904
陌清茗
陌清茗 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:39

    You could use FindFirstFile which returns a handle and then recursively cal a function which calls FindNextFile.This is a good aproach as the structure referenced would be filled with various data such as alternativeName,lastTmeCreated,modified,attributes etc

    But as you use .net framework, you would have to enter the unmanaged area.

提交回复
热议问题