能力值:
( LV2,RANK:10 )
|
-
-
2 楼
你参考一下吧.
void CGetfilenameDlg::GetFileNmae(char szFilePath[MAX_PATH])
{
int i=1;
CFileFind finder;
sprintf(szFilePath,"%s\\*.*",szFilePath);
BOOL bGet=finder.FindFile(szFilePath);
CString str,str1,str2,str3;
char szSonPath[MAX_PATH];
while (bGet)
{
bGet=finder.FindNextFile();
if(finder.IsDots())
continue;
if(finder.IsDirectory())
{
str=finder.GetFileTitle();
//////目录下所有文件
str3.Format("[%s]",str);
WriteStr(str3);
i=1;
sprintf(szSonPath,"%s",str);
GetFileNmae(szSonPath);
}
else
{
str1=finder.GetFileName();
str2.Format("File%d=%s",i,str1);
WriteStr(str2);
i++;
}
}
finder.Close();
}
|
能力值:
(RANK:1010 )
|
-
-
3 楼
FindFirstFile/FindNextFile
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
|
|
|