[ gygy @ 14.11.2004. 12:19 ] @
Koristim: Edit: TEdit DriveComboBox1: TDriveComboBox DirectoryListBox: TDirectoryListBox Brojfajlova: TLabel grid: TStringGrid Directory: TDirectoryListBox FileListBox: TFileListBox Code: procedure TForm1.Button1Click(Sender: TObject); var rootDir:string; procedure bros(const root:string); var i,j,dirIterate:word; subdirs:TstringList; a,b:string; begin subdirs:=Tstringlist.Create; Directory.Directory:=root; Directory.OpenCurrent; a:=floattostr(j); if FileListBox.items.count>0 then for j:=0 to FileListBox.items.count-1 do begin grid.cells[0,grid.RowCount-1]:=fileListBox.Items[j]; grid.cells[1,grid.RowCount-1]:=root; grid.cells[2,grid.RowCount-1]:=NazivFajla(a); grid.RowCount:=grid.RowCount+1; end; if not(Directory.ItemIndex=Directory.Items.Count-1) then begin for i:=Directory.ItemIndex+1 to Directory.Items.count-1 do begin if Directory.itemindex=0 then subdirs.add(Directory.Directory+Directory.Items[i]) else subdirs.add(Directory.Directory+'\'+Directory.Items[i]); end; for dirIterate:=0 to subdirs.Count-1 do bros(subdirs[dirIterate]); end; subdirs.Free; end; begin FileListBox.Mask:='*.'+Edit.text; grid.RowCount:=2; grid.Cells[0,1]:=''; grid.Cells[1,1]:=''; grid.Cells[0,0]:='Naziv fajla'; grid.Cells[1,0]:='Lokacija'; screen.Cursor:=-11; bros(DirectoryListBox.Directory); if grid.RowCount > 2 then grid.RowCount:=grid.RowCount-1; if grid.cells[0,1]<>'' then Brojfajlova.Caption:='Ukupan broj pronadjenih fajlova: '+inttostr(grid.rowcount-1) else Brojfajlova.Caption:='Ukupan broj pronadjenih fajlova: 0'; screen.Cursor:=0; end; Ovaj gore navedeni kod koristim i sve lepo ferca. All... Program u prvoj koloni prikazuje naziv fajla, a u drugoj lokaciju. Samo zelim da ne prikazuje ekstenziju fajla. Npr u prvoj koloni Anastacia - Left Outside Alone.mp3.....da bude.....Anastacia - Left Outside Alone Blacke Eyed Peas - Shut Up.mp3.........da bude.....Blacke Eyed Peas - Shut Up znaci da nema *.mp3 Da li neko zna kako da ovo resim? Unapred hvala!!! |