procedure FindFiles(StartFolder, Mask: string; List: TStrings;
ScanSubFolders: Boolean = True);
var
SearchRec: TSearchRec;
FindResult: Integer;
begin
List.BeginUpdate;
try
StartFolder := IncludeTrailingBackslash(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;
if (Attr and faDirectory) = faDirectory then
FindFirst(StartFolder + 'test*.*', faAnyFile, SearchRec)
FindResult := FindFirst(StartFolder + '*.*', faDirectory , SearchRec)
Uses SysUtils ;
var
sr: TSearchRec;
begin
if FindFirst('*.*', faDirectory, sr) = 0 then
repeat
if (sr.Attr and faDirectory) = faDirectory then
WriteLn(sr.Name, ' ', sr.attr)
else
WriteLn(sr.attr);
until FindNext(sr) <> 0;
FindClose(sr);
end.
procedure FindFiles(StartFolder, Mask: string; List: TStringList;
ScanSubFolders: Boolean = True);
var
SearchRec: TSearchRec;
FindResult: Integer;
begin
List.BeginUpdate;
try
StartFolder := IncludeTrailingBackslash(StartFolder);
FindResult := FindFirst(StartFolder + '*.*', faAnyFile, SearchRec);
try
while FindResult = 0 do
with SearchRec do
begin
if (Attr and faDirectory) = faDirectory then
if ScanSubFolders and (Name <> '.') and (Name <> '..') then
begin
FindFiles(StartFolder + Name, Mask, List, ScanSubFolders);
List.Add(StartFolder + Name);
end;
FindResult := FindNext(SearchRec);
end;
finally
FindClose(SearchRec);
end;
finally
List.EndUpdate;
end;
end;
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.