특정 폴더 파일, 하위 폴더를 삭제하는 함수 구현
void etDataBase::RemoveDir(CString strDir, BOOL bOnlyFile/* = false*/)
{
CFileFind finder;
BOOL bWorking = TRUE;
CString strDirFile = strDir + CString("\\*.*");
bWorking = finder.FindFile(strDirFile);
while(bWorking)
{
bWorking = finder.FindNextFile();
if(finder.IsDots()) continue;
if(finder.IsDirectory() && !bOnlyFile) RemoveDir(finder.GetFilePath());
else ::DeleteFile(finder.GetFilePath());
}
finder.Close();
if (!bOnlyFile)
::RemoveDirectory(strDir);
}
위오 같이 처리하면 됨
LIST
'MFC' 카테고리의 다른 글
| CryptGetUserKey() 함수 이용시 에러 발생시 확인 방법 (0) | 2016.09.30 |
|---|---|
| unicode CString to char* (0) | 2016.09.20 |
| 바이트 순서 변환 함수 (0) | 2016.03.16 |
| Error C2039: 'Enable3dControls' : is not a member of 'CWinApp' (0) | 2016.03.10 |
| MSXML2에서 indentation 처리 방법 (0) | 2016.03.07 |