//选择文件
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
MessageBox.Show(ofd.FileName); //选择文件夹
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.ShowDialog();
MessageBox.Show(fbd.SelectedPath);
2023-10-07 21:36:52
//选择文件
OpenFileDialog ofd = new OpenFileDialog();
ofd.ShowDialog();
MessageBox.Show(ofd.FileName); //选择文件夹
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.ShowDialog();
MessageBox.Show(fbd.SelectedPath);