VB.NET
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\");
ListFileInfo> 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.
VulpesRank #55 · 29.2K reputationPosted Nov 30, 2011, 7:53 AM EST
In case that's the problem I'd try:
list.RemoveAll(n => n.Name.ToUpper() == "CHIPHIPAA.CSV");
A RepaskyRank #8,108 · 228 reputationPosted Nov 30, 2011, 8:33 AM EST
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