Follow by Email

How to Delete files from folder?

Here is code ...........

DirectoryInfo di = new System.IO.DirectoryInfo("DirecotyPath");
FileInfo[] allFiles = di.GetFiles(searchPattern);
foreach (FileInfo file in allFiles)
{
file
.Delete();
}

0 comments:

Post a Comment