unit Unit1; { browse .c dla ansi c } // delphi pascal - browsing catalogs, subdirectory, przeszukiwanie katalogow podkatalogow folderow interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; sc0,sc1:string; pl:tsearchrec; i, bl:longword; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin {============= algorytm przeszukiwania katalogow ===============} { podaj dysk } sc0:='C:\'; bl:=findfirst(concat(sc0,'*.*'),$10,pl); repeat if(concat(sc0,pl.name,'\')<>sc1)and (pl.attr=$10)and(pl.name<>'.') and(pl.name<>'..')and(bl=0) then begin sc0:=concat(sc0,pl.name,'\'); bl:=findfirst(concat(sc0,'*.*'),$3f,pl); end; if copy(pl.name,length(pl.name)-3,4)='.EXE'then begin Memo1.lines.add(sc0+pl.name+' '+IntToStr(i)); {tu wybierasz pliki } end; bl:=findnext(pl); if(bl<>0){and(sc0<>'c:\')}then begin i:=length(sc0); sc1:=sc0; repeat delete(sc0,i,1); i:=i-1; until (sc0[i]='\')or (i=1); bl:=findfirst(concat(sc0,'*.*'),$10,pl); if (concat(sc0,pl.name,'\')<>sc1) then begin repeat bl:=findnext(pl); until ((concat(sc0,pl.name,'\')=sc1) and(pl.attr=$10))or(bl<>0); end; end; until (bl<>0); end; {=========== xvr.pl ===== Maciej K ==============================} end.