ArrayList GetAll(DirectoryInfo dir)//搜索文件夹中的文件
{
ArrayList FileList = new ArrayList();
FileInfo[] allFile = dir.GetFiles();
foreach (FileInfo fi in allFile)
{
FileList.Add(fi.Name);
}
DirectoryInfo[] allDir= dir.GetDirectories();
foreach (DirectoryInfo d in allDir)
{
GetAll(d);
}
return FileList;
}
DirectoryInfo d = new DirectoryInfo(@"F:\");
ArrayList Flst= GetAll(d);