MFC 中 CFindFile 的用法
Posted SweetLoverFT
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MFC 中 CFindFile 的用法相关的知识,希望对你有一定的参考价值。
void TraversFile(CString csPath)
CString csPrePath = csPath;
CString csNextPath = csPath;
CFileFind ff;
csPath += _T("*.*");//遍历这一级全部的目录
int nResult = ff.FindFile(csPath);
while(nResult)
nResult = ff.FindNextFileW();
if(ff.IsDirectory() && !ff.IsDots())//递归遍历
wcout << (LPCTSTR)ff.GetFilePath() << endl;
csNextPath += ff.GetFileName();
csNextPath += _T("\\\\");
TraversFile(csNextPath);
csNextPath = csPrePath;
很简单,没什么好说的~
以上是关于MFC 中 CFindFile 的用法的主要内容,如果未能解决你的问题,请参考以下文章