static void DeleteDirectories(CString csPath)
{
CFileFind finder;
CString tempPath;
tempPath.Format("%s%s", csPath, "//*.*");
BOOL bWork = finder.FindFile(tempPath);
while(bWork)
{
bWork = finder.FindNextFile();
if(!finder.IsDots())
{
if(finder.IsDirectory())
{
DeleteDirectories(finder.GetFilePath());
}
else
{
DeleteFile(finder.GetFilePath());
}
}
}
finder.Close();
RemoveDirectory(csPath);
}
【MFC】VC 删除目录和文件
最新推荐文章于 2021-11-19 15:48:47 发布