C# 打开文件对话框

 OpenFileDialog dialog = new OpenFileDialog();
            dialog.Multiselect = true;//该值确定是否可以选择多个文件
            dialog.Title = "请选择文件夹";
            dialog.Filter = "所有文件(*.*)|*.*";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string file = dialog.FileName;
                textBox2.Text = file;
            }

 

posted @ 2022-03-02 11:12  学竹  阅读(361)  评论(0编辑  收藏  举报