c# - 如何克服 PathTooLongException?

标签 c# path pathtoolongexception

所以我正在编写一个程序来扫描计算机上的重复文件,因为我看到的程序非常慢,和/或占用大量内存,但我遇到了 PathTooLongException当我尝试整个驱动器时。看完PathTooLongException in C# code我对以下两个问题感到好奇。

  1. 如果我每次更改级别时都切换当前目录,是否会影响我的性能?

  2. 有没有更好的方法来获取所有文件的目录结构(也许通过调用类似 tree.exe 的东西然后解析它)?

最佳答案

关于c# - 如何克服 PathTooLongException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6119505/

相关文章:

c# - Filesystemwatcher 导致 "Error too many changes at once in directory C:\"

python - 从特定目录中选择文件

python - Pathlib - 加入 n 个 parent

windows - pipenv 在安装依赖项时找不到模块 'runpy'

c# - Directory.SetCurrentDirectory 抛出 PathTooLongException

c# - .NET Designer 中的 "could not find type System.Collections.Generic.List"是什么?

c# - 通过身份验证时从 Web API Controller 操作返回图像

c# - 如何将 .Net 中的 System.Decimal 四舍五入到一些有效数字

visual-studio-2010 - 安装 Visual Studio 扩展时出现 PathTooLongException

c# - PathTooLongException C# 4.5