//Delete files from specified path that have the specified extensions
private void delete_ext(string path, string ext)
{
string[] fileNames = System.IO.Directory.GetFiles(path);
foreach ( string strFiles in fileNames )
{
System.IO.FileInfo info = new System.IO.FileInfo(strFiles);
if (info.Extension.ToLower() == ext.ToLower())
{
System.IO.File.Delete(info.ToString());
}
}
}