c#文件操作

弹出选择框可以选择指定类型文件的完整路径  

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

原文地址:https://www.cnblogs.com/ganzhihui/p/10119416.html