void GetFileName (char * FilePath , char *FileType)
{
FILE * fp = fopen ("MusicName.txt" , "w+");
if (!fp)
return ;
_finddata_t FileInfo;
long findhandle;
char cmd[260];
sprintf (cmd , "%s%s" , FilePath , FileType);
findhandle = _findfirst (cmd , &FileInfo);
fputs (FileInfo.name , fp);
while (! _findnext (findhandle , &FileInfo))
{
fputs ("\n" , fp);
fputs (FileInfo.name , fp);
//
printf ("%d\n" , FileInfo.size);
}
fputs ("\n" , fp);
fclose (fp);
}
搞定,跟这个差不多。谢谢啦。