//获取子文件夹路径
void get_dirs(CString strPath, vector <CString>& dirs)
{
vector<CString> vecFiles = {};
//获取文件夹下所有子文件夹名
CString strFilePath;
//int64 dwDirSize = 0;
strFilePath += strPath;
strFilePath += "//*.*";
CFileFind finder;
BOOL bFind = finder.FindFile(strFilePath);
while (bFind)
{
bFind = finder.FindNextFile();
if (!finder.IsDots())
{
CString strTempPath = finder.GetFilePath();
if (finder.IsDirectory())
{
//dirs.push_back(strTempPath);// 遍历子文件夹
TraverseDir(strTempPath, dirs);
}
else
{
continue;
}
}
}
finder.Close();
}
void main()
{
CString strDir;
strDir = ".\\image";
vector<CString> vFilePathList;
get_dirs(strDir, vFilePathList);
}