CFileFind file;
         int count=0
BOOL bContinue = file.FindFile(fdirectoryPath + "\\*.*"); while( bContinue )
{
bContinue = file.FindNextFile(); if(!file.IsDirectory() && !file.IsDots())  //不是文件夹
{

                           ........................
count++;
CString strFile = file.GetFileName();省略号的地方应该怎么做?

解决方案 »

  1.   

    判断系统属性可用
    CFileFind::IsSystem
    BOOL IsSystem( ) const;如果用打开方式的,需要用try捕捉异常,代价高,速度慢,不值
      

  2.   

    CFileFind file; BOOL bContinue = file.FindFile(fdirectoryPath + "\\*.*"); while( bContinue )
    {
    bContinue = file.FindNextFile(); if(!file.IsDirectory() && !file.IsDots() && !file.IsSystem ())   {
    count++;
    }
    }
    解决~!!
      

  3.   

    CFileFind file; BOOL bContinue = file.FindFile(fdirectoryPath + "\\*.*"); while( bContinue )
    {
    bContinue = file.FindNextFile(); if(!file.IsDirectory() 
                         && !file.IsDots() 
                         && (_access( file.GetFileName(), 2 )) != -1 )  
                           //_access( file.GetFileName(), 2 )判断是否有写权限
    {
    count++;