首页 > Windows开发 > 详细

windows 下遍历文件夹

时间:2014-11-26 10:57:08      阅读:206      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 1 void reversedir(string srcDir)
 2 {
 3     struct _finddata_t filefind;
 4     string  imgName = srcDir + "\\*.*";
 5     int done=0, handle;  
 6 
 7     if(( handle =_findfirst(imgName.c_str(), &filefind)) == -1)
 8         return;
 9 
10     while(!(done=_findnext(handle, &filefind)))     
11     {         
12         if(!strcmp(filefind.name,"..")){  
13             continue;  
14         }                     
15         if((_A_SUBDIR==filefind.attrib))
16         {             
17             printf("----------%s\n",filefind.name);      
18             cout<< filefind.name << "(dir)" <<endl;     
19         }     
20         else
21         {     
22                 //file
23         }     
24     } 
25     _findclose(handle);
26 }      
View Code

 

windows 下遍历文件夹

原文:http://www.cnblogs.com/VincentLEcho/p/4122514.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!