如题!

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/2863/2863759.xml?temp=.9876825
      

  2.   

    呵呵,好啊,我这里正好有代码,仅供参考,不过要给分哦:
    void  GetFileInfo(LPCTSTR pstr)

       int iSum;
       CFileFind finder;
       CString Path;
       Path.Format("%s\\*.*",pstr);   BOOL bWorking=finder.FindFile(Path);  while (bWorking)
       {     
          bWorking=finder.FindNextFile();  
          //找到的是“.”或“..”
      if(finder.IsDots())
      {
      continue;
      }
      //找到的是目录   
      if((finder.IsDirectory()))
      {  
            CString str=finder.GetFilePath();
    int a,b;
    a=g_iKnowSum;
    b=g_iUnKnowSum;
            GetFileInfo(str);
      }
          //找到的是文件
      else
      { 
        //此处添加对找到文件的操作!
                                   
      }
      } 
    }
      

  3.   

    只要你认真看过候捷的《深入浅出MFC》
      

  4.   

    http://cnprogram.myrice.com/article/vc/vc513.html
      

  5.   

    char szPath[256];
    struct _finddata_t file;
    long hFile;
    char szFileName[256];sprintf(szPath,"%s\\*.*","c:\\test");if( (hFile = _findfirst( szPath, &file ) ) == -1L )
    {
    _findclose( hFile );
    return ERR;
    }do 
    {
    if ( (strcmp(file.name, ".") != 0 ) &&
         (strcmp(file.name, "..") != 0) )
             {
         sprintf(szFileName,"%s\\%s",szPath,file.name);//file name }while( _findnext(hFile,&file) == 0);     _findclose( hFile );
      

  6.   

    CFileFind fileFind;
    CString path = "d:\\*.*"; BOOL m_finding = fileFind.FindFile(path);
        while(m_finding == TRUE)
    {
    m_finding = fileFind.FindNextFile();
    if(!fileFind.IsDirectory() && !fileFind.IsDots())//文件
    {
    AfxMessageBox(fileFind.GetFilePath());
    }

    if(fileFind.IsDirectory() && !fileFind.IsDots())//目录
    {
    AfxMessageBox(fileFind.GetFilePath());
    }
    } fileFind.Close();