c# 通过按钮获取文件夹和打开磁盘文件

Button控件获取文件夹:

1  FolderBrowserDialog fileDialog = new FolderBrowserDialog();
2  if (fileDialog.ShowDialog() == DialogResult.OK)
3  {
4     MessageBox.Show(fileDialog.SelectedPath);
5  }


Button打开磁盘文件夹:

 1 System.Diagnostics.Process.Start("explorer.exe", FilePath); 

原文地址:https://www.cnblogs.com/hbtmwangjin/p/7602807.html