sr: TSearchRec;
FindFirst(Local_path + '\*.*', faDirectory, sr)这句话什么意思啊,还有 FindNext(sr)?
这两个函数的作用是什么?返回值是什么?

解决方案 »

  1.   

    下面是Delphi中关于FindFirst的帮助说明
    Searches for the first instance of a file name with a given set of attributes in a specified directory.DescriptionFindFirst searches the directory specified by Path for the first file that matches the file name implied by Path and the attributes specified by the Attr parameter. The result is returned in the F parameter. Use the fields of this search record to extract the information needed. FindFirst returns 0 if a file was successfully located, otherwise, it returns an error code.The Path constant parameter is the directory and file name mask, including wildcard characters. For example, '.\test\*.*' specifies all files in the current directory).The Attr parameter specifies the special files to include in addition to all normal files. Choose from these file attribute constants when specifying the Attr parameter:Constant Description
    faReadOnly Read-only files
    faHidden Hidden files
    faSysFile System files
    faVolumeID Volume ID files
    faDirectory Directory files
    faArchive Archive files
    faAnyFile Any file
    Attributes can be combined by adding (Delphi) or or-ing (C++) their constants or values. For example, to search for read-only and hidden files in addition to normal files, pass (faReadOnly + faHidden) in Delphi or (faReadOnly | faHidden) in C++ as the Attr parameter.Note: FindFirst allocates resources (memory) which must be released by calling FindClose.
      

  2.   

    查找指定目录下的所有子目录,具体在你的另一贴已有说明。
    http://community.csdn.net/Expert/topic/4159/4159488.xml没办法,有时候只能硬着头皮看,可以开个金山词霸什么的辅助一下:)。帮助里的英文一般还是不太难懂的,时间长了应该就习惯了。
    祝进步
      

  3.   

    首部   function FindFirst(const Path: string; Attr: Integer; var F: TSearchRec): Integer; $[SysUtils.pas功能    返回设置文件搜索 说明    搜索成功则返回 0
    procedure TForm1.Button1Click(Sender: TObject);var  vSearchRec: TSearchRec;  I: Integer;begin  Memo1.Clear;  I := FindFirst(Edit1.Text, faAnyFile, vSearchRec);  while I = 0 do begin    Memo1.Lines.Add(vSearchRec.Name);    I := FindNext(vSearchRec);  end;  FindClose(vSearchRec);end;
      

  4.   

    首部   function FindNext(var F: TSearchRec): Integer; $[SysUtils.pas功能    返回继续文件搜索 说明    搜索成功则返回 0参考   function Windows.FindNextFile例子   < 参见 FindFirst>━━━━━━━━━━━━━━━━━━━━━ 首部   procedure FindClose(var F: TSearchRec); $[SysUtils.pas功能    结束当前文件搜索 说明    不关闭查询会占用系统资源