void FindFile(LPCTSTR lpfile)
{
CFileFind finder;
BOOL bl=finder.FindFile(lpfile);// 当前目录
while(bl)
{
bl=finder.FindNextFile();
if(finder.IsDots())// 当前目录和上级目录
{
}
else if(finder.IsDirectory())// 子目录
{
CString cstemp;
cstemp.Format("%s",finder.GetFilePath());
cstemp+="\\*.*";
FindFile((LPCTSTR)cstemp);
}
else
{
finder.GetFilePath();// 文件
}
}
}CFileFind 遍历文件
最新推荐文章于 2022-08-30 08:47:11 发布
本文详细介绍了如何使用C++实现文件搜索与遍历的功能,包括查找文件、目录及子目录,并获取文件路径。
4963

被折叠的 条评论
为什么被折叠?



