枚举一个文件夹下的所有文件名

来源:互联网 发布:网络机顶盒港澳台直播 编辑:程序博客网 时间:2024/05/22 05:30
void ShowFiles(CString Path){   CString File_name;   CFileFind file;   BOOL nContinue;   nContinue = file.FindFile(Path);   if(!nContinue)     return;   while(nContinue)  {    nContinue = file.FindNextFile();   if(file.IsDots()) continue;   else if(file.IsDirectory())  {     CString Cpath;     int Index = Path.ReverseFind('\\');     Cpath = Path.Left(Index);     Cpath +="\\"+file.GetFileName();     Cpath +="\\*.*";     ShowFiles(Cpath);      }  else  {    AfxMessageBox(file.GetFileName());   }  }}
0 0