using System;
using System
using System
using System
using System
namespace Jiangmingxiang
{
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
{
myfilelistpath
myfilelistname
}
foreach (DirectoryInfo diSourceSubDir in source
{
ListAll(diSourceSubDir);
}
}
}
}
From:http://tw.wingwit.com/Article/program/net/201311/13526.html