https://www.cnblogs.com/qc-id-01/p/7489021.html
FolderBrowserDialog dialog = new FolderBrowserDialog(); dialog.Description = "请选择文件路径"; //dialog.RootFolder = Environment.SpecialFolder.Programs; if (dialog.ShowDialog() == DialogResult.OK) { string foldPath = dialog.SelectedPath;
}
//选择文件 OpenFileDialog dialog = new OpenFileDialog(); dialog.Multiselect = true;//该值确定是否可以选择多个文件 dialog.Title = "请选择文件夹"; dialog.Filter = "所有文件(*.*)|*.*"; if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string file = dialog.FileName; }
|
请发表评论