1 Directory dir; 2 vector<string> Folders = dir.GetListFolders(dir_path, "*", false);// 获取指定路径下所有子文件夹的名称 3 Directory dirs; 4 for (size_t i = 0; i < Folders.size(); ++i){ 5 vector<string> fileNames = dirs.GetListFiles(dir_path + Folders.at(i) + "/", "*", false);// 获取所有子文件夹内文件名称 6 for (size_t j = 0; j < fileNames.size(); ++j){ 7 8 string fileName = fileNames[j]; 9 string fileFullName = dir_path + Folders.at(i) + "/" + fileName;// 获取文件的绝对路径 10 11 } 12 13 }View Code