procedure
TForm1
.
FileSearch(
const
dirName:
string
);
var
searchResult: TSearchRec; a :
array
[
1..255
]
of
Integer
;
begin
if
FindFirst(dirName+
'\*'
, faAnyFile, searchResult)=
0
then
begin
try
repeat
if
(searchResult
.
Attr
and
faDirectory)=
0
then
begin
if
SameText(ExtractFileExt(searchResult
.
Name),
'.jpg'
)
then
begin
ListBox2
.
Items
.
Append(IncludeTrailingBackSlash(dirName)+searchResult
.
Name);
memo3
.
Lines
.
Add(inttostr(searchResult
.
Size));
end
;
end
else
if
(searchResult
.
Name<>
'.'
)
and
(searchResult
.
Name<>
'..'
)
then
begin
FileSearch(IncludeTrailingBackSlash(dirName)+searchResult
.
Name);
end
;
until
FindNext(searchResult)<>
0
finally
FindClose(searchResult);
end
;
end
;
end
;