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);
温馨提示:内容为网友见解,仅供参考