I have a pretty urgent application, but want to try and do it in C# instead of VB6. I need to search subfolders of a selected folder. Inside these subfolders, I want to return the files that have the pattern "*_LOG_*.tx t". I keep running into an issue though. I try to declare an array of FileInfo[] type, but the declaration insists I use a constructor that doesn't take 0 arguements. I got around this by placing in a dummy text string "foo.txt". When I attempt to add to the array using the following statement, I get an error:
currentSubDir.G etFiles("*_LOG_ *txt").CopyTo(r eturnArray, returnArray.Cou nt());
I thought that if I specify the count, it would add to the end of the array. Can someone help me get unstuck?
The error I get is Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
currentSubDir.G etFiles("*_LOG_ *txt").CopyTo(r eturnArray, returnArray.Cou nt());
I thought that if I specify the count, it would add to the end of the array. Can someone help me get unstuck?
The error I get is Destination array was not long enough. Check destIndex and length, and the array's lower bounds.
Comment