function searchFile(path:string):Integer;
var SearchRec:TSearchRec;
found,fileCount:Integer;
begin
fileCount:=0;
found:=FindFirst(Path+'\*.*',faAnyFile,searchRec);//查找第一个文件
while found=0 do
begin
found:=FindNext(SearchREc);//查找下一个个文件
Inc(fileCount);//文件总数
end;
Result:=fileCount;
end;