zoukankan      html  css  js  c++  java
  • 遍历文件夹下所有文件夹[多级]

    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); //递归调用
         }
    }

  • 相关阅读:
    每日日报
    每日日报
    JAVA日报
    JAVA日报
    JAVA日报
    JAVA日报
    NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}
    2020.11.07
    2020.11.05
    2020.11.09
  • 原文地址:https://www.cnblogs.com/johnpher/p/2570709.html
Copyright © 2011-2022 走看看