if (FindFirst(FilePath+'*.*', faDirectory, SearchRec)=0) then  
begin
end
我知道这条是扫描某路径下的所有文件但我现在只想扫描某路径下的文件名包含'aa'的log文件???这个要怎么过滤啊???
如一个文件夹有这些文件 bb1.log  bb2.log  aa1.log aa2.log我现在只想扫描 aa1.log aa2.log 文件

解决方案 »

  1.   

    if (FindFirst(FilePath+'aa*.log', faDirectory, SearchRec)=0) then  
    begin
    end
    好像是这样的
      

  2.   

    http://hi.baidu.com/glfbin/blog/item/488415436de3231773f05ddb.html
      

  3.   


    var
      Found: TSearchRec;
      finished: integer;
      filePath: string;
      str: string;
    begin
      filePath:='c:\';
      try
        Finished := FindFirst(filePath + 'a*.log', faAnyfile, Found);
        while Finished = 0 do
        begin
          if (Found.Name <> '.') and (Found.Name <> '..') then
          begin
            ShowMessage('aaa');
          end;
          Finished := FindNext(Found);
        end;
      finally
        FindClose(Found);
     end;
      

  4.   

    if (FindFirst(FilePath+'*.*', faAnyFile, SearchRec)=0) then 才是对应任何文件吧