Just write one line code to delete the files from the directory.
string dirPath = "C://XMLFiles";
//search for the xml files in the directory and delete all files
new List(Directory.GetFiles(dirPath,@"*.xml")).ForEach(file => { File.Delete(file); });
Here, I am deleting all the XML files from the dirPath directory.
string dirPath = "C://XMLFiles";
//search for the xml files in the directory and delete all files
new List
Here, I am deleting all the XML files from the dirPath directory.
No comments:
Post a Comment