c++查找文件的方法
2012-10-12 17:53
176 查看
CFileFind finder;
BOOL bWorking = finder.FindFile(szBuf);
unsigned short slogtype = 0;
while (bWorking)
{
bWorking = finder.FindNextFile();
CString strfilename = finder.GetFilePath();
CString strtype = "";
int iposs = strfilename.Find("\\Log_") + 5;
int ipose = strfilename.Find("_R.txt");
if (iposs < ipose)
{
strtype = strfilename.Mid(iposs, (ipose-iposs));
slogtype = atoi(strtype.GetBuffer(0));
parseFile(strfilename, slogtype);
}
else
{
return FALSE;
}
}
finder.Close();
BOOL bWorking = finder.FindFile(szBuf);
unsigned short slogtype = 0;
while (bWorking)
{
bWorking = finder.FindNextFile();
CString strfilename = finder.GetFilePath();
CString strtype = "";
int iposs = strfilename.Find("\\Log_") + 5;
int ipose = strfilename.Find("_R.txt");
if (iposs < ipose)
{
strtype = strfilename.Mid(iposs, (ipose-iposs));
slogtype = atoi(strtype.GetBuffer(0));
parseFile(strfilename, slogtype);
}
else
{
return FALSE;
}
}
finder.Close();
相关文章推荐
- C++利用 _findfirst与_findnext查找文件的方法
- 查找文件夹下所有文件方法c++
- 查找文件的方法有这么多……
- VC C/C++ 4种方法获取文件大小 Windows API
- 在C++中实现文件的读写的基本方法
- vs2010 2012 c++ 为项目添加不同目录下文件方法
- windows下查找空文件的方法
- Linux系统下查找文件的方法
- linux下查找某个文件位置的方法
- C++ 调用Python文件方法传递字典参数并接收返回值
- 获取文件大小的六种方法大全,打开文件和不打开文件都有,C方法获取,C++方法获取,MFC方法获取。
- linux c遍历文件夹 和文件查找的方法
- C++ 控制台打印无输出 无法查找或打开PDB文件
- php查找指定目录下指定大小文件的方法
- C和C++获取文件大小的方法总结
- C++用 _findfirst 和 _findnext 查找文件
- c++实现二叉树的查找,插入,删除,深度,叶子节点数,度为1的节点数(递归方法)及运行实例结果
- Eclipse查找文件方法
- C++ stl 复制文件的方法
- linux系统中批量查找文件与文件内容的方法