function SearchFiles(Dir: String): Int64;
var
sr : TSearchRec;
FindRes:Integer;
begin
Result:=0;
Dir := IncludeTrailingBackslash(Dir);
FindRes:=FindFirst(Dir + '*.*', faAnyFile, sr);
While FindRes=0 do begin
If (sr.Name <> '.') And (sr.Name <> '..') Then
if (sr.Attr And faDirectory)>0 Then begin
SL1.Add(Dir+sr.Name);//TStringlists.
SearchFiles(Dir+sr.Name)
end else begin
SL2.Add(sr.Name);//TStringlists.
end;
FindRes:=FindNext(sr);
end;
FindClose(sr);
end;
|