unit
del;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, masks, ExtCtrls,ComObj, ShlObj;
type
TForm1 =
class
(TForm)
memo1: TMemo;
procedure
FormCreate(Sender: TObject);
private
public
end
;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure
FindFiles(StartFolder, Mask:
string
; List: TStrings;
ScanSubFolders:
Boolean
=
True
);
var
SearchRec: TSearchRec;
FindResult:
Integer
;
begin
List
.
BeginUpdate;
try
StartFolder := IncludeTrailingPathDelimiter(StartFolder);
FindResult := FindFirst(StartFolder +
'*.*'
, faAnyFile, SearchRec);
try
while
FindResult =
0
do
with
SearchRec
do
begin
if
(Attr
and
faDirectory) <>
0
then
begin
if
ScanSubFolders
and
(Name <>
'.'
)
and
(Name <>
'..'
)
then
FindFiles(StartFolder + Name, Mask, List, ScanSubFolders);
end
else
begin
if
MatchesMask(Name, Mask)
then
List
.
Add(StartFolder + Name);
end
;
FindResult := FindNext(SearchRec);
end
;
finally
FindClose(SearchRec);
end
;
finally
List
.
EndUpdate;
end
;
end
;
procedure
TForm1
.
FormCreate(Sender: TObject);
var
f:
file
of
byte
;
g, l, r:
integer
;
s, oldName, newName, blob :
string
;
begin
FindFiles(
'C:\1\', '
pro?.*', memo1
.
lines,
true
);
for
r :=
0
to
Memo1
.
Lines
.
Count-
1
do
begin
.................
МОЙ КОД
.................
end
;
end
;
end
.