private string[] GetFiles()
        {
            string[] files = null;
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            dlg.Multiselect = true;
            //dlg.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            //dlg.FilterIndex = 2; 
            //dlg.RestoreDirectory = true;
            if (dlg.ShowDialog() == true)
                files = dlg.FileNames;
            return files;
        }

dlg.Multiselect = true;//设置是否可以多选

相关文章:

  • 2022-12-23
  • 2022-02-23
  • 2021-11-15
  • 2022-02-02
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-06-21
  • 2022-12-23
相关资源
相似解决方案