private void DeleteFolder(string dirPath, bool bRecursive)
{
DirectoryInfo dir = new DirectoryInfo(dirPath);
if (bRecursive)
{
DirectoryInfo[] directories = dir.GetDirectories();
foreach (DirectoryInfo di in directories)
{
DeleteFolder(di.FullName, bRecursive);
}
}
FileInfo[] files = dir.GetFiles();
foreach (FileInfo fi in files)
{
fi.Delete();
}
}
댓글 없음:
댓글 쓰기