void CLeftView::BrowseCurrentDir(CString strDir)
{

 //遍历文件夹下的所有文件夹
     if(strDir == _T(""))
     {
         return;
     }
     else
     {
          if(strDir.Right(1) != _T("//"))
               strDir += L"//";
          strDir =strDir+_T("*.*");
     }

 

     CFileFind finder;
     CString strPath;
     BOOL bWorking = finder.FindFile(strDir);

 

     while(bWorking)
     {
         bWorking = finder.FindNextFile();

         strPath = finder.GetFilePath(); 


         if(!finder.IsDots() && finder.IsDirectory())
                 MessageBox(strPath, 0, 0);

         if(finder.IsDirectory() && !finder.IsDots())
              BrowseCurrentDir(strPath); //递归调用
     }
}

 posted on 2011-03-05 16:25  Jiang, X.  阅读(396)  评论(0编辑  收藏  举报