遍历文件夹下内容
2015-07-14 11:16
197 查看
void __fastcall TFormBdsManager::FindDir(char* parent,String ExPandName) { HANDLE hFile = NULL; WIN32_FIND_DATA fd = {0}; String Parerntstr=AnsiString(parent)+"\\*.*"; hFile = ::FindFirstFile(Parerntstr.c_str(), &fd); if(hFile != INVALID_HANDLE_VALUE) { do { int temp=fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY; if(temp) { if (AnsiString(fd.cFileName)==".") { continue; } if (AnsiString(fd.cFileName)=="..") { continue; } char UseFileName[500]; StrCopy(UseFileName,fd.cFileName); String Parerntstr1=AnsiString(parent)+"\\"+AnsiString(fd.cFileName); FindDir(Parerntstr1.c_str(),ExPandName); } else { String Exd=ExtractFileExt(AnsiString(fd.cFileName)); String Fullfilename=AnsiString(fd.cFileName); if (Exd!=".fxd") // if (filename.Pos(".fxd")<=0) { continue; } String name=GetFileNameNoExe(Fullfilename); if (GetfileIsOneServer(name)) { continue; } BdsInfo * temp=new BdsInfo(); memset(temp->BdsName,0,sizeof(temp->BdsName)); StrCopy(temp->BdsName,name.c_str()); temp->LastModifyTime=GetDirLastTime(AnsiString(parent)+"\\"+AnsiString(fd.cFileName)); temp->ComeForm=0; TListItem *itemuse=lvList->Items->Add(); itemuse->Caption=IntToStr(itemuse->Index); itemuse->Data=temp; UseBdsInfo.push_back(*temp); } }while(FindNextFile(hFile, &fd)); FindClose(hFile); hFile = NULL; } }
相关文章推荐
- 1006. Sign In and Sign Out (25)
- 【QT】 屏幕旋转、尺寸设置
- js的contextmenu,beforeunload,unload事件
- Abstract Classes and Factory Design Pattern in Python
- Git与Repo入门
- Random Sample - Reservoir
- DATAGRID固定表头【转】
- C++中引用(&)的用法和应用实例 - blue—— - 博客园
- 在SQLite Expert上用日期类型字段作为条件查询时注意日期的格式化
- 什么是smarty?
- 6.用插入排序对任意一组随机数据进行随机数组进行排序(用循环和递归两种方法)
- iPhone开发过程中调试多次Release问题 message sent to deallocated
- hive on tez集成
- http://www.jb51.net/article/37855.htm
- 黑马day18 鼠标事件&图片变大
- HashMap与ConcurrentHashMap的区别
- QTabBar 绘制底边 样式
- Functional MRI (second edition) -- 5. MR Contrast Mechanisms and Pulse Sequences
- SQL2005四个排名函数(row_number、rank、dense_rank和ntile)的比较
- VirtualBox - 自动调整屏幕大小,显示分辨率