My code to delete file as follow,
string path = Server.MapPath("files//" + file_name);
FileInfo file = new FileInfo(path);
if (file.Exists)//check file exsit or not
{
file.Delete();
}
Let's say, I've files as following in files folder
1- Agreement.pdf
2- Agreement.doc
3- Agreement.docx
How to delete all these files with name Agreement? Don't bother the Extention
Please help
Go to the complete details ...