64,682
社区成员
发帖
与我相关
我的任务
分享
void GetFiles(string Path, vector<string> &file)
{
long hFile = 0;
struct _finddata_t FileInfo;
string p;
if ((hFile = _findfirst(p.assign(Path).append("\\*").c_str(),&FileInfo)) != -1)
{
do
{
if (FileInfo.attrib & _A_SUBDIR)
{
if (strcmp(FileInfo.name,".") != 0 && strcmp(FileInfo.name,"..") != 0)
{
GetFiles(p.assign(Path).append("\\").append(FileInfo.name),file);
}
}
else
{
file.push_back(p.assign(Path).append("\\").append(FileInfo.name));
}
} while (_findnext(hFile,&FileInfo) == 0);
_findclose(hFile);
}
}