Delete


Delete

Deletes an existing file
This method will throw an exception if the file is in use or if you do not have access (or permission) to delete it.
It will not throw an exception if the file does not exist.

System.IO.File.Delete(path); 

string[] delList = System.IO.Directory.GetFiles(folder, "*.png"); 
foreach (string filename in delList)
{
   System.IO.File.Delete(filename);
}


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext