C# 选择文件夹 选择文件

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;
            }

上一篇:【DB笔试面试742】在Oracle中,cvuqdisk包的作用是什么?


下一篇:【DB笔试面试733】在Oracle中,RAC中REMOTE_LISTENER的作用是什么?