This is very easy .User can delete file using File.Delete Keyword .this method is using for deleting file(s) from particular folder with specified format.
if you want to delete a bmp file in a NewFolder in the E Disk.
public void DeleteFiles(String Path, String fileType)
{
string[] files = Directory.GetFiles(Path, fileType);
foreach (string file in files)
{
File.Delete(file);
}
}
string[] files = Directory.GetFiles(Path, fileType);
foreach (string file in files)
{
File.Delete(file);
}
}
DeleteFiles("Specify Path","Particular File Type");
eg:
if you want to delete a bmp file in a NewFolder in the E Disk.
DeleteFiles("E:\\NewFolder\\","*.bmp");