2,640
社区成员
发帖
与我相关
我的任务
分享
CString strName;
strName.Format(_T("%s\\*.*"), lpFilePath);//strDir:要查找的目录
TCHAR chFile[MAX_PATH];
TCHAR chTemp[MAX_PATH];
CFileFind find;
BOOL bFinished=find.FindFile(strName);
HTREEITEM hCurNode;
while(bFinished)
{
bFinished =find.FindNextFile();
if (!find.IsDots()&&!find.IsHidden()) //不是隐藏文件
{
_tcscpy(chTemp, find.GetFileName().GetBuffer(255));
if(find.IsDirectory())
{
fun(find.GetFilePath()); //递归
}
else
{
//AfxMessageBox(find.GetFilePath());
}
}
}