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

OpenFileDialog dialog = new OpenFileDialog();
dialog.Multiselect = true;//该值确定是否可以选择多个文件
dialog.Title = "请选择文件夹";
dialog.Filter = "所有文件(*.*)|*.*";
if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
    string []files = dialog.FileNames;
}
posted @ 2017-07-21 16:47  旗木卡卡赵赵  阅读(645)  评论(0编辑  收藏  举报