循环变量文件夹中的文件
来源:互联网 发布:1hhhh最新区域名 编辑:程序博客网 时间:2024/06/05 22:57
void AddAttachment(CString FilePath) //去找到临时文件夹中名字中含有"_log.zip"结束的文件
{
CFileFind objfinder; // 文件查找对象
CString cstrFilePath; // 下一个文件
CString cstrPath = FilePath + _T("\\*.*");
BOOL bFind; // 查找标记
CTime tempTime;
bFind = objfinder.FindFile(cstrPath);
// 目录不存在
if ( !bFind )
{
objfinder.Close();
//return FALSE;
}
// 目录存在
while ( bFind )
{
bFind = objfinder.FindNextFile(); // 如果是目录 递归文件夹底下的所有文件
if (objfinder.IsDots()) // 判断是否为.或..过滤
{
bFind = objfinder.FindNextFile();
continue;
}
if(objfinder.IsDirectory())
{
CString cstrFilePath = objfinder.GetFilePath();
AddAttachment(cstrFilePath);
}
else
{
cstrFilePath = objfinder.GetFileName();//循环去查找文件路径
if (cstrFilePath.Find(".rar") != -1)
{
CMySmtp::stPathFile stTemp;
stTemp.Path = FilePath;
stTemp.File = cstrFilePath;
g_listAttachmentFileName.push_back( stTemp );
}
}
} // end while
objfinder.Close();
//return TRUE;
}
{
CFileFind objfinder; // 文件查找对象
CString cstrFilePath; // 下一个文件
CString cstrPath = FilePath + _T("\\*.*");
BOOL bFind; // 查找标记
CTime tempTime;
bFind = objfinder.FindFile(cstrPath);
// 目录不存在
if ( !bFind )
{
objfinder.Close();
//return FALSE;
}
// 目录存在
while ( bFind )
{
bFind = objfinder.FindNextFile(); // 如果是目录 递归文件夹底下的所有文件
if (objfinder.IsDots()) // 判断是否为.或..过滤
{
bFind = objfinder.FindNextFile();
continue;
}
if(objfinder.IsDirectory())
{
CString cstrFilePath = objfinder.GetFilePath();
AddAttachment(cstrFilePath);
}
else
{
cstrFilePath = objfinder.GetFileName();//循环去查找文件路径
if (cstrFilePath.Find(".rar") != -1)
{
CMySmtp::stPathFile stTemp;
stTemp.Path = FilePath;
stTemp.File = cstrFilePath;
g_listAttachmentFileName.push_back( stTemp );
}
}
} // end while
objfinder.Close();
//return TRUE;
}
- 循环变量文件夹中的文件
- 循环读取文件夹中的文件
- 循环获取文件夹中子文件夹中的文件
- 判断是否为文件夹 , 循环文件夹中的文件
- 循环某个文件夹下子文件中的文件,删除
- 每天学点C++_2.循环读取文件夹中的文件
- php循环得到文件夹文件
- js中的循环变量声明
- 枚举文件夹中的文件
- 遍历文件夹中的文件
- 文件夹中的.nomedia文件
- 遍历文件夹中的文件
- 遍历文件夹中的文件
- matlab循环读写文件、变量
- 循环路径文件夹下的文件
- linux shell 循环处理文件夹每个文件
- Python循环创建文件或文件夹
- 循环读取文件夹下的文件
- 使用与或运算完成两个整数的相加
- 视频编码与封装方式详解
- Qt中动态链接库的使用
- 分辨率、像素、密度和屏幕尺寸的关系(换算)
- oracle 向存储过程传入数组类型参数
- 循环变量文件夹中的文件
- 递归文件夹底下的所有文件
- 解决IE提示“是要保存此文件,还是联机查找程序来打开此文件”
- ms-inter
- <夺命金>背后的真实香港情况
- CentOS5.4上海交大YUM源
- 的撒旦撒旦撒
- Android学习笔记之cyanogenmod编译篇
- android 屏保锁中屏掉按键和HOME键的方法