zoukankan      html  css  js  c++  java
  • delphi 文件搜索,遍历所有子目录

    function ListFiles(path: string): TStringList;
    var
      SearchRec: TSearchRec;
      found: integer;
    begin
      result := TStringList.Create;
      found := FindFirst(path + '' + '*.*', faAnyFile, SearchRec);
      if not DirectoryExists(path) then
      begin
        Result.Clear;
        exit;
      end;
      while found = 0 do
      begin
        if (SearchRec.Name <> '.') and (SearchRec.Name <> '..') and (SearchRec.Attr <> faDirectory) then
        begin
          if ExtractFileExt(SearchRec.Name) = '.dfm' then
            result.Add(path + '' + SearchRec.Name);
        end
        else if (SearchRec.Attr = faDirectory) and (SearchRec.Name <> '.') and (SearchRec.Name <> '..') then
        begin
          Result.AddStrings(ListFiles(path + '' + SearchRec.Name));
        end;
        found := FindNext(SearchRec);
      end;
      FindClose(SearchRec);
    end;

    http://blog.csdn.net/y281252548/article/details/51659208

  • 相关阅读:
    类与类之间的关系图
    UML介绍
    数据建模
    状态图
    部署图
    用例图
    业务建模
    时序图
    postgresql 维护手册
    ashx文件的使用(转)
  • 原文地址:https://www.cnblogs.com/findumars/p/4999145.html
Copyright © 2011-2022 走看看