#include <dirent.h>
DIR *dp;
struct dirent *dirp;
if((dp=opendir(szTemp))==NULL)
{
printf("目录名不正确/n");
return -1;
}
num=0;
while((dirp=readdir(dp))!=NULL)
{
if(strcmp(dirp->d_name,".")==0 || strcmp(dirp->d_name,"..")==0)
continue;
strcpy(szPath[num],dirp->d_name);
num++;
}
DIR *dp;
struct dirent *dirp;
if((dp=opendir(szTemp))==NULL)
{
printf("目录名不正确/n");
return -1;
}
num=0;
while((dirp=readdir(dp))!=NULL)
{
if(strcmp(dirp->d_name,".")==0 || strcmp(dirp->d_name,"..")==0)
continue;
strcpy(szPath[num],dirp->d_name);
num++;
}