How to read File names recursively from subfolder using LINQ

前端 未结 5 1213
鱼传尺愫
鱼传尺愫 2021-01-13 09:36

How to read file name with dll extension from a directory and from its subfolders recursively using LINQ or LAMBDA expression.

Now i\'m using Nested for

5条回答
  •  渐次进展
    2021-01-13 10:08

    Reading files and directories is usually done with classes situated in the System.IO namespace. So the first step would consist into getting all the files that you need to read using the Directory.EnumerateFiles method and then for each file that corresponds to your search criteria read the contents using for example the File.ReadAllBytes method.

提交回复
热议问题