CFileFind 遍历目录与子目录
生活随笔
收集整理的這篇文章主要介紹了
CFileFind 遍历目录与子目录
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
/*作者:sysprogram
???編寫日期:2011年4月2日
???博客:http://hi.csdn.net/SysProgram
*/
?
void MyFindFile(CString strPath)
{
?CFileFind hFileFind;
?strPath+="//*.*";
?BOOL bWorking = hFileFind.FindFile(strPath,0);
?while(bWorking)
?{
??bWorking = hFileFind.FindNextFile( );
??if (hFileFind.IsDots())
??{
???continue;
??}
??if (hFileFind.IsDirectory())
??{
???MyFindFile(hFileFind.GetFilePath());
??}
??OutputDebugString(hFileFind.GetFilePath());
?}
?hFileFind.Close();
}
?
void CTestCFileDlg::OnBUTTONFind()
{
?// TODO: Add your control notification handler code here
?MyFindFile("D://test");
}
?
總結
以上是生活随笔為你收集整理的CFileFind 遍历目录与子目录的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CFile读写文件 实现复制文件功能
- 下一篇: 远程线程DLL注入