C# Windows Forms - Select and Copy Multiple Files w MultiSelect, OpenFileDialog, & FileBrowserDialog -


I am developing a WinForms application using C # with OpenFileDialog and FileBrowserDialog and I want to:

< Li> Enable selection of multiple xls files
  • After selecting, display the selected xlsx filenames in the text box
  • Copy the selected files to a different directory consolidate

    How can I do this?

    Here is the sample code:

      openfileDialog od = new open fileDialog ( ); Od.Filter = "XLS files | * .xls"; Od.Multiselect = True; If (od.ShowDialog () == System.Windows.Forms.DialogResult.OK) {string tempFolder = System.IO.Path.GetTempPath (); Foreach (string filename in od.FileNames) {System.IO.File.Copy (filename, tempFolder + @ "\" + System.IO.Path.GetFileName (fileName)); }}    

  • Comments