I added the 3rd line below to remove the one filename from the list.
Do I have to combine the Sort and RemoveAll? Anyway it does not seem to be working.
Arep
DirectoryInfo directoryInfo = new DirectoryInfo(@"E:\Data\KidsCert\FileNet\");
List<FileInfo> list = directoryInfo.GetFiles().ToList();
list.RemoveAll(n => n.Name == "CHIPHIPAA.csv");
list.Sort((a, b) => string.Compare(a.Name, b.Name));foreach (var item in list)
.......etc.
Loading
VulpesPosted Nov 30, 2011, 12:53 PM
In case that's the problem I'd try:
list.RemoveAll(n => n.Name.ToUpper() == "CHIPHIPAA.CSV");
A RepaskyPosted Nov 30, 2011, 1:33 PM
I had to rebuild it, now it works. I have a class library and everytime I make a change I guess I have to rebuild the project.
arep