using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.IO;
namespace Jiangmingxiang.Program.FileList
{
public class FileList
{
//字段声明
private ArrayList myfilelistpath = new ArrayList();
private ArrayList myfilelistname = new ArrayList();
//属性声明
public ArrayList GetFileListPath
{
get { return myfilelistpath; }
}
public ArrayList GetFileListName
{
get { return myfilelistname; }
}
//构造函数
public FileList(string sourceDirectory)
{
DirectoryInfo diSource = new DirectoryInfo(sourceDirectory);
ListAll(diSource);
}
public void ListAll(DirectoryInfo source)
{
foreach (FileInfo fi in source.GetFiles())
{
myfilelistpath.Add(fi.FullName + fi.Name);
myfilelistname.Add(fi.Name);
}
foreach (DirectoryInfo diSourceSubDir in source.GetDirectories())
{
ListAll(diSourceSubDir);
}
}
}
}