|
#1
|
|||
|
|||
Delphi листинг
Нужен листинг программы помогите пожалуйста
|
#2
|
|||
|
|||
Ну, примерно так (не проверял):
Код:
procedure TForm1.Button1Click(Sender : TObject); var sPath : String; begin sPath := Edit2.Text; if SelectDirectory(sPath,[sdAllowCreate, sdPerformCreate, sdPrompt],SELDIRHELP) Then Edit2.Text := sPath; end; procedure TForm1.Button1Click(Sender : TObject); var sMask : String; sRootDir : String; begin sMask := Edit1.Text; sRootDir := IncludetrailingPathDelimiter(Edit2.Text); FndFiles(sRootDir,sMask); end; procedure FndFiles(sRoot : String; sMask : String); var iFound : Integer; F : TSearchRec; begin // Files iFound := FindFirst(sRoot + sMask,faAnyFile,F); While iFound = 0 Do Begin if (F.Attr And faDirectory) = 0 Then ListBox1.Items.Add(sRoot + F.Name); iFound := FindNext(F); End; FinsClose(F); // Dirs iFound := FindFirst(sRoot + '*.*',faDirectory,F); While iFound = 0 Do Begin if (F.Name <> '.') And (F.Name <> '..') And ((F.Attr And faDirectory) <> 0) Then FndFiles( IncludeTrailingPAthDelimiter(sRoot + F.Name),sMask); iFound := FindNext(F); End; FinsClose(F); end; |