public object delDirectory(string dirPath)
{
if (!(Directory.Exists(dirPath)))
{
return false;
}
string[] fileEntries = Directory.GetFiles(dirPath);
foreach (string fileName in fileEntries)
{
File.Delete(fileName);
}
string[] subdirectoryEntries = Directory.GetDirectories(dirPath);
foreach (string subdirectory in subdirectoryEntries)
{
delDirectory(subdirectory);
}
Directory.Delete(dirPath);
return true;
}
Saturday, February 13, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment