void DeleteAll(const CString& str1)
{
CFileFind ff;
CString currrentDir = str1;
CString str = str1;
if(str.Right(1) != "\\")
str+="\\";
str+="*.*";
BOOL bRes = ff.FindFile(str);
while(bRes)
{
bRes = ff.FindNextFile();
if(!ff.IsDirectory()&&!ff.IsDots())
{
DeleteFile(ff.GetFilePath());
}
else if(ff.IsDirectory()&&!ff.IsDots())
{
if( !RemoveDirectory( ff.GetFilePath().GetBuffer(MAX_PATH) ) )
DeleteAll(ff.GetFilePath());
}
}
ff.Close();
::RemoveDirectory( currrentDir.GetBuffer(MAX_PATH) );
}
{
CFileFind ff;
CString currrentDir = str1;
CString str = str1;
if(str.Right(1) != "\\")
str+="\\";
str+="*.*";
BOOL bRes = ff.FindFile(str);
while(bRes)
{
bRes = ff.FindNextFile();
if(!ff.IsDirectory()&&!ff.IsDots())
{
DeleteFile(ff.GetFilePath());
}
else if(ff.IsDirectory()&&!ff.IsDots())
{
if( !RemoveDirectory( ff.GetFilePath().GetBuffer(MAX_PATH) ) )
DeleteAll(ff.GetFilePath());
}
}
ff.Close();
::RemoveDirectory( currrentDir.GetBuffer(MAX_PATH) );
}