MFC 中 CFindFile 的用法

来源:互联网 发布:淘宝卖啥最赚钱排行 编辑:程序博客网 时间:2024/05/19 03:45
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;    }}

很简单,没什么好说的~
0 0
原创粉丝点击