T
tshad
Is there an easy way to get and move a set of FileInfo object (in a
FileInfo[] array) to another array by month?
I am getting list of files in my folder (about 100,000 of them):
FileInfo[] strFiles = null;
DirectoryInfo dirinfo = new DirectoryInfo(FilePath);
strFiles = dirinfo.GetFiles("*." + extension);
What I want to do is say get only the files with LastWriteTime equal to some
month?
I then pass the new array to my procedure which will process whatever is
there. I would them come back and do the same thing for another month and
then have that array processed.
GetFiles doesn't have a filter by month, so I have to do it after the fact.
I could loop through and look for files that match the request month and
then move that object to another array, but I was wondering if there is an
easier way.
Thanks,
Tom
FileInfo[] array) to another array by month?
I am getting list of files in my folder (about 100,000 of them):
FileInfo[] strFiles = null;
DirectoryInfo dirinfo = new DirectoryInfo(FilePath);
strFiles = dirinfo.GetFiles("*." + extension);
What I want to do is say get only the files with LastWriteTime equal to some
month?
I then pass the new array to my procedure which will process whatever is
there. I would them come back and do the same thing for another month and
then have that array processed.
GetFiles doesn't have a filter by month, so I have to do it after the fact.
I could loop through and look for files that match the request month and
then move that object to another array, but I was wondering if there is an
easier way.
Thanks,
Tom