http://baike.baidu.com/view/1186290.htm?fr=aladdin
使用io.h中的_findfirst,_findnext,_findclose,_finddata_t。
#include <io.h>
#include <stdio.h> int main()
{
long Handle;
struct _finddata_t FileInfo; if((Handle=_findfirst("*.*",&FileInfo))==-1L)
printf("Not found!\n");
else
{
printf("%s\n",FileInfo.name);
while(_findnext(Handle,&FileInfo)==)
printf("%s\n",FileInfo.name);
_findclose(Handle);
}
return ;
}