C# 獲取資料夾路徑和資料夾包含檔案列表
FolderBrowserDialog用來選擇資料夾
FolderBrowserDialog dialog = new FolderBrowserDialog();
dialog.ShowDialog()
之後才會開啟資料夾選擇框。
dialog.SelectedPath是選擇的資料夾的完整路徑
DirectoryInfo theFolder = new DirectoryInfo(foldPath);
FileInfo[] dirInfo = theFolder.GetFiles();
得到這個資料夾中的檔案列表(陣列形式)供使用。