We're working on moving files from one server to another. The last time we did this, we used vb Script. We move around a million files (took several days).
We're looking to speed up the process, as this looks like it's going to be a recurring process with possibly more files to be moved going forward.
Parameters:
Here's the idea:
Question:
My experience with c# is what I've learned in the last few days. If you need some of the code I've created already, let me know.
I would suggest reversing the order to minimize the GetFiles
:
Store all parameters into an array
Store all the files on the path:
var files = Directory.GetFiles("PATH")
Loop through the array and find the met parameters:
var ans = parameters.SelectMany(parameter => files.Where(s => s.Contains(parameter)))
.Distinct()
.ToList();