sr: TSearchRec;
FindFirst(Local_path + '\*.*', faDirectory, sr)这句话什么意思啊,还有 FindNext(sr)?
这两个函数的作用是什么?返回值是什么?
FindFirst(Local_path + '\*.*', faDirectory, sr)这句话什么意思啊,还有 FindNext(sr)?
这两个函数的作用是什么?返回值是什么?
解决方案 »
- delphi里面有没有既可以删除文件又可以删文件夹的通用函数?
- 尝试做一个木马查杀程序,如何收集或者建立木马特征库
- 如何用IHTMLDocument2修改网页源代码再显示?
- 请问如何:将excell内容导入到access数据库中,以及将access的内容导出到excell中去?
- 在DELPHI中怎么用SendMessage函数得到某一句柄中的内容!!!!
- jpg文件保存出现问题!
- 关于combobox的style属性的动态设置?
- 有没有兴趣加盟Delphi网上开发小组?
- 看看计算机图书是如何写出来的吧,你还敢买吗
- 应用程序隐藏后如何重现?
- 准备做个小程序,有几个问题,问问大家
- 如何设置rave,能使它打印出AODQuery中的内容。
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.
http://community.csdn.net/Expert/topic/4159/4159488.xml没办法,有时候只能硬着头皮看,可以开个金山词霸什么的辅助一下:)。帮助里的英文一般还是不太难懂的,时间长了应该就习惯了。
祝进步
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;