A ad Aug 23, 2006 #1 Hi, How can I delete all files in a folder by C# for example, I want to delete all files under c:\Test
Hi, How can I delete all files in a folder by C# for example, I want to delete all files under c:\Test
G Greg Young Aug 23, 2006 #2 Try Directory.Delete http://msdn2.microsoft.com/en-us/library/fxeahc5f.aspx Remember to pass true to tell it to recurse subdirectories etc. Cheers, Greg Young MVP - C# http://codebetter.com/blogs/gregyoung
Try Directory.Delete http://msdn2.microsoft.com/en-us/library/fxeahc5f.aspx Remember to pass true to tell it to recurse subdirectories etc. Cheers, Greg Young MVP - C# http://codebetter.com/blogs/gregyoung
J John Duval Aug 23, 2006 #4 Hi ad, Could you just iterate over the files? string[] files = Directory.GetFiles(@"C:\temp"); foreach (string file in files) File.Delete(file); John
Hi ad, Could you just iterate over the files? string[] files = Directory.GetFiles(@"C:\temp"); foreach (string file in files) File.Delete(file); John