剛在噗浪上看到有人花了不少時間寫列舉目錄下所有檔案的class,記得當初鳥毅也在CodeProject上找了一會兒,以下是鳥毅改寫的Code(原始出處忘了留:P ),授權以原始出處為準(逃~) Update:我改寫的class似乎太像(十年前的)Java,請看回應laneser寫的版本,這才是.Net風格呀。 using System; using System.Collections; using System.IO; namespace tenyi.io { public class FileExplorer { public ArrayList FileList = new ArrayList(); public ArrayList extensionLists = null; private string myPath = null; private bool recursive = true; private DateTime lastDateTime = new DateTime(1, 1, 1); public DateTime LastDateTime { get { return lastDateTime; } } public FileExplorer(string path) { myPath = path; recursive = false; FileList = GetFiles(myPath); } public FileExplorer(string path, string filter) { myPath = path; recursive = false; FileList = GetFiles(myPath, filter); } public FileExplorer(string path, ArrayList extensions) { myPath = path; extensionLists = extensions; recursive = false; FileList = GetFiles(myPath); } public FileExplorer(string path, ArrayList extensions, string filter) { myPath = path; extensi...