C# 怎么遍历电脑的所有磁盘查找文件

2025-02-25 14:19:30
推荐回答(1个)
回答1:

DriveInfo.GetDrives() 获取所有驱动器名

DirectoryInfo(Path).GetFiles("*.*")获取Path下面所有文件

然后递归遍历。