2012-05-17
首先声明一个list用于存放文件路径
然后调用方法即可获取
private void GetFileList(DirectoryInfo diroot) { foreach (FileInfo fileName in diroot.GetFiles()) { listFile.Add(fileName.FullName); } foreach (DirectoryInfo dirSub in diroot.GetDirectories()) { GetFileList(dirSub); } }