Findfile

zhaozj2021-02-16  61

Procedure Findfiles (StartDir: String);

VAR

SR: tsearchrec; // Some data used to store the returned file

IsFound: boolean; // is a sign

Begin

ISFound: = Findfirst (StartDir '*. Htm', faanyfile-fadirectory, sr) = 0;

// Find htm files in STARTDIR

While IsFound Do Begin

// If you find an HTM file

GetEmailaddress (StartDir Sr.Name);

/ / Call our own defined function, the passdir sr.name is the absolute path of the file.

// Note, the function getting getETEMAILADDRESS we will wait

ISFound: = FINDNEXT (SR) = 0;

/ / Continue to find the HTM file, only to the logo isfound to false

END;

FindClose (SR);

IsFound: = FindFirst (StartDir '*. *', FAANYFILE, SR) = 0;

/ / Now look for all files

While IsFound Do Begin

IF ((Sr.attr and fadirectory <> 0) and (sr.name [1] <> '.'). ')

Findfiles (StartDir Sr.Name '/');

// If the file is a directory, and not "." Or "..", then continue to find in this directory, that is, recursive here.

ISFound: = FINDNEXT (SR) = 0;

END;

FindClose (SR);

END;

转载请注明原文地址:https://www.9cbs.com/read-19335.html

New Post(0)