Windows C++ 子目录数量

    CFileFind OneFile;
    BOOL bWorking = FALSE;
    long total = 0;

    if (strPath.Right(1) != "\")
    {
        strPath += "\*.*";
    }

    bWorking = OneFile.FindFile(strPath);
    while (bWorking)
    {
        bWorking = OneFile.FindNextFile();
        if (OneFile.IsDirectory() && !OneFile.IsDots())
        {
            total++;
        }
    }
    OneFile.Close();
    return total;
原文地址:https://www.cnblogs.com/klxll/p/3193695.html