// 获得目录下的所有文件列表
vector<CString> _vecFileName;
CString _strPath;
_strPath = "c:\\";
CFileFind _finder;
BOOL _bFind = _finder.FindFile(_strPath + "*.*");
while (_bFind)
{
_bFind = _finder.FindNextFile();
if (_finder.IsDots())
{
continue;
}
if (_finder.IsDirectory())
{
continue;
}
CString _strFileName;
_strFileName = _finder.GetFileName();
if (_strFileName.Find(_T(".jpg"), 0) >= 0 ||
_strFileName.Find(_T(".JPG"), 0) >= 0)
{
_strFileName = _strPath + _strFileName;
_vecFileName.push_back(_strFileName);
}
}
获取指定目录下所有的文件名
最新推荐文章于 2021-12-09 15:00:09 发布