I have the following solution to delete a single file type with only one extension; however I am trying to find a way to incorporate multiple file extensions, for example: .wma, .mp3, .wav
DirectoryInfo di = new DirectoryInfo(@"C:\");
FileInfo[] files = di.GetFiles("*.mpeg")
.Where(p => p.Extension == ".mpeg").ToArray();
foreach (FileInfo file in files)
try
{
file.Attributes = FileAttributes.Normal;
File.Delete(file.FullName);
}
catch { }