ファイルをコピーする。
BOOL xxxxxx::CopyAll(LPCTSTR OldFolder, LPCTSTR NewFolder)
{
CFileFind FileFind;
CString Str;
Str.Format( _T("%s\\*.*"), OldFolder );
FileFind.FindFile( Str, 0 );
while( FileFind.FindNextFile() != 0 ){
if( FileFind.IsDots() != 0 ){ continue; }
CString Name= FileFind.GetFileName();
CString Dst;
Dst.Format( _T("%s\\%s"), NewFolder, Name );
CopyFile( FileFind.GetFilePath(), Dst, FALSE );
}
return TRUE;
}
BOOL xxxxxx::CopyAll(LPCTSTR OldFolder, LPCTSTR NewFolder)
{
CFileFind FileFind;
CString Str;
Str.Format( _T("%s\\*.*"), OldFolder );
FileFind.FindFile( Str, 0 );
while( FileFind.FindNextFile() != 0 ){
if( FileFind.IsDots() != 0 ){ continue; }
CString Name= FileFind.GetFileName();
CString Dst;
Dst.Format( _T("%s\\%s"), NewFolder, Name );
CopyFile( FileFind.GetFilePath(), Dst, FALSE );
}
return TRUE;
}
PR
この記事にコメントする