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;

 

posted @ 2013-07-16 16:46  呵呵··  阅读(236)  评论(0编辑  收藏  举报