EVC 递归添加文件夹下面的文件
来源:互联网 发布:电脑格式化后数据恢复 编辑:程序博客网 时间:2024/09/21 07:52
http://blog.csdn.net/yearafteryear/archive/2010/01/14/5188924.aspx
- GetAllFileInfo(LPCWSTR fileTypePath)
- {
- WIN32_FIND_DATA AlbumData;
- HANDLE hSearch;
- bool bFinished=false;
- CString Str=fileTypePath, strTemp;
- //开始按搜索条件搜索
- CString strsearch = Str;
- strsearch += L"//*";
- hSearch=FindFirstFile(strsearch,&AlbumData);
- if(hSearch==INVALID_HANDLE_VALUE)
- {
- return;
- }
- //开始递归搜索
- do
- {
- //对当前目录和上一级目录进行判断过滤
- if (wcscmp(AlbumData.cFileName, L".") == 0 || wcscmp(AlbumData.cFileName, L"..") == 0)
- {
- continue;
- }
- if (AlbumData.dwFileAttributes == FILE_ATTRIBUTE_DIRECTORY) //目录
- {
- CString strFilePathTemp = Str;
- strFilePathTemp += L"//";
- strFilePathTemp += AlbumData.cFileName;//获得此目录的绝对路径进行递归搜索
- GetAllFileInfo(strFilePathTemp);
- }
- else //找到文件进行判断是否是目标文件类型
- {
- CString strTemp = AlbumData.cFileName, strsuffix;
- strsuffix = strTemp.Mid(strTemp.ReverseFind(L'.')+1); //文件的后缀名
- if (wcscmp(strsuffix, L"mp3") == 0 || wcscmp(strsuffix, L"wav") == 0 || wcscmp(strsuffix, L"wma") == 0)
- {
- CString strs = Str;
- strs += L"//";
- strs += AlbumData.cFileName;
- if(nTotalFileCount<MAXNUM)
- {
- PathAndFileName[nTotalFileCount]=strs;
- nTotalFileCount++;
- }
- else
- {
- AfxMessageBox(TEXT("内存有限请不要再添加"));
- break;
- }
- }
- }
- } while(FindNextFile(hSearch,&AlbumData));
- if(!FindClose(hSearch))
- {
- AfxMessageBox(_T("关闭查找句柄失败"));
- }
- }
- EVC 递归添加文件夹下面的文件
- 递归添加文件夹下面的文件
- 递归显示指定文件夹下面的文件
- 递归删除某个文件夹下面的所有文件和文件夹
- 递归删除指定文件夹下面的文件和文件夹
- 自动递归获取文件夹下面的文件列表
- 递归删除某文件夹下面的指定文件 mac
- 【典型例题】遍历文件夹下面的文件;(递归算法)
- 循环遍历某个文件夹下面的所有文件,递归方法
- java扫描文件夹下面的所有文件(递归与非递归实现)
- EVC下文件夹/文件操作
- Java使用线程池递归压缩文件夹下面的所有子文件
- PHP递归根据分辨率更改文件夹下面的所有文件名字
- 判断文件夹下面是否还有文件(递归方式)
- 如何遍历某个文件夹下面的文件
- php删除文件夹及下面的文件
- servlet遍历文件夹下面的文件
- 列出一个文件夹下面的所有文件
- SWT 右键菜单
- EBS数据迁移和报告工具-iSetup
- 奇怪!但的确是真的:关于以sp_开头的表
- ASP.NET 里面的各种路径
- DB2中的数据移动 (整理)
- EVC 递归添加文件夹下面的文件
- 伤心
- 关于java中==;!=;equal()的一点点思考
- Spring JdbcTemplate 实现自定义分页
- c# winform 系统托盘图标的创建与简单使用
- 轻轻松松教你把U盘做成系统安装盘
- tcpdump
- vi复制多行文本的方法
- 幽默的经济学原理