文件夹浏览时dialogresult要写全引用路径
1 string path=null; 2 FolderBrowserDialog fbd = new FolderBrowserDialog(); 3 fbd.Description = "请选择文件夹"; 4 if (fbd.ShowDialog()==System.Windows.Forms.DialogResult.OK) 5 { 6 path = fbd.SelectedPath; 7 8 9 } 10 foreach(string fileName in System.IO.Directory.GetFiles(path)) 11 { 12 System.Windows.Forms.MessageBox.Show(fileName); 13 }