更新时间:2023-12-01 20:58:28
检查此链接
http://***.com/questions/172544/ignore-文件夹文件何时拒绝目录访问 [ http://***.com/questions/4986293/使用目录获取文件时访问路径被拒绝 [
Check this links
http://***.com/questions/172544/ignore-folders-files-when-directory-getfiles-is-denied-access[^]
http://***.com/questions/4986293/access-to-the-path-is-denied-when-using-directory-getfiles[^]
我想给你一个大的关于System.IO.Directory.GetFiles
的警告.它不像您期望的那样起作用.
请参阅以下讨论: Directory.Get.Files搜索模式问题 [ ^ ].
请注意解决此方法问题的此片段:Where(item => item.ToLower().EndsWith(ExtExe));
—SA
I want to give you a big warning aboutSystem.IO.Directory.GetFiles
. It does not work like you expect it.
See this discussion: Directory.Get.Files search pattern problem[^].
Pay attention to this fragment which fixes the problem of this method:Where(item => item.ToLower().EndsWith(ExtExe));
—SA