C# 选择文件夹 选择文件
2021-10-05 13:15
标签:blog res col lte filename file multi dial pat 选择文件 1 //选择文件 2 OpenFileDialog dialog = new OpenFileDialog(); 3 dialog.Multiselect = true;//该值确定是否可以选择多个文件 4 dialog.Title = "请选择文件夹"; 5 dialog.Filter = "所有文件(*.*)|*.*"; 6 if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK) 7 { 8 string file = dialog.FileName; 9 } 选择文件夹 1 FolderBrowserDialog dialog = new FolderBrowserDialog(); 2 dialog.Description = "请选择文件路径"; 3 dialog.SelectedPath = path; 4 //dialog.RootFolder = Environment.SpecialFolder.Programs; 5 if (dialog.ShowDialog() == DialogResult.OK) 6 { 7 string foldPath = dialog.SelectedPath; 8 } C# 选择文件夹 选择文件标签:blog res col lte filename file multi dial pat 原文地址:http://www.cnblogs.com/qc-id-01/p/7489021.html
上一篇:C# 反射小结
下一篇:JS 实现关闭浏览器