private void SHCopyFiles(string[] sourceFiles, string destinationFolder) { ShellFileOperation fo = new ShellFileOperation(); List <string> destinationFiles = new List <string>(); foreach (string sourceFile in sourceFiles) { destinationFiles.Add(Path.Combine(destinationFolder, Path.GetFileName(sourceFile))); } fo.InvokeOperation(this.Handle, FileOperations.Copy, sourceFiles, destinationFiles.ToArray()); }
private void SHCopyFiles(string[] sourceFiles, string destinationFolder) { ShellFileOperation fo = new ShellFileOperation(); List<string> destinationFiles = new List<string>(); foreach (string sourceFile in sourceFiles) { destinationFiles.Add(Path.Combine(destinationFolder, Path.GetFileName(sourceFile))); } fo.InvokeOperation(this.Handle, FileOperations.Copy, sourceFiles, destinationFiles.ToArray()); }
private void SHCopyFiles(string[] sourceFiles, string destinationFolder) { ShellFileOperation fo = new ShellFileOperation(); fo.InvokeOperation(this.Handle, FileOperations.Copy, sourceFiles, sourceFiles.Select(sourceFile => Path.Combine(destinationFolder, Path.GetFileName(sourceFile))).ToArray()); }