http://baike.baidu.com/view/1186290.htm?fr=aladdin
使用io.h中的_findfirst,_findnext,_findclose,_finddata_t。
1 #include2 #include 3 4 int main() 5 { 6 long Handle; 7 struct _finddata_t FileInfo; 8 9 if((Handle=_findfirst("*.*",&FileInfo))==-1L)10 printf("Not found!\n");11 else12 {13 printf("%s\n",FileInfo.name);14 while(_findnext(Handle,&FileInfo)==0)15 printf("%s\n",FileInfo.name);16 _findclose(Handle);17 }18 return 0;19 }