How to delete multiple files

I would go with Mr. @acaciomelo 's solution , but if you want in a single line you can try somethinking like below

Array.ForEach(Directory.GetFiles(@"c:\MyDir\"), File.Delete);

11 Likes