c# 打开文件夹获取所有文件

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

转载于:https://www.cnblogs.com/ssjsk/p/7218539.html

你可能感兴趣的:(c#)