删除指定目录及其子目录和文件

private void deletefile(System.IO.DirectoryInfo path)
{
foreach(System.IO.DirectoryInfo d in path.GetDirectories())
{
deletefile(d);
}
foreach(System.IO.FileInfo f in path.GetFiles())
{
f.Delete();
}
}

posted @ 2012-11-08 12:05  与时俱进  阅读(578)  评论(0编辑  收藏  举报
友情链接:同里老宅院民居客栈