Exclude files with a certain extension from list

string invalidExtension = (from p in new List<string> 
{ ".dll", ".pdb", ".suo", ".docstates", ".ico", ".bmp", ".vs10x", ".vspscc", ".vssscc", ".vsp", ".scc", ".user", ".ctl", ".datasource", ".vsmdi", ".testsettings", ".trx", ".dat" }
                            where p == files[i].Extension.ToLower()
                            select p).FirstOrDefault();
 
if (string.IsNullOrEmpty(invalidExtension))
{
//Means it has an invalid extension
}

Comments

Popular posts from this blog

Enable Visual Studio to use more than 2GB of memory

Firefox and Chrome dark mode

Dealing with the morons who built Dell 7710 and RAID