[Delphi] Wyszukiwanie dodatkowe opcje :-)

0

witam mam kodzik na wyszukiwanie plików i katalogow dzialający zresztą
dobrze ale mam problem chce dodac inne atrybuty niż tylko nazwa katalogu i
pliku chodzi mi o rozmiar, date, atrybuty pliku itd ale nie wiem jak to
zrobic wszystko mi sie wyświetla w listview u mnie w kodzie listview ma
nazwe LISTA
to tyle i dzieki za wszelką pomoc
Pozdriawiam
ps. chcialem zastosowac
szukaj(dir + srec.Name + floattostr(srec.size), list, mask); ale dziwnie sie to zachowuje :\

*----------------------------------------------------------------------------------------
procedure TForm1.szukaj(dir: String; var list: TstringList; mask: String);
var
SRec: TSearchRec;
res: Integer;
ec: Char;

begin
ec := ':';
if dir '' then ec := dir[Length(dir)];
if (ec '\') and (ec ':') then dir := dir + '\';
res := FindFirst(dir + mask, faArchive, SRec);
while res = 0 do begin
list.Add(dir + SRec.Name);
res := FindNext(SRec);
end;
FindClose(SRec);
res := FindFirst(dir + '*', faDirectory, SRec);
while res = 0 do begin
if (SRec.Attr and faDirectory 0)
and (SRec.Name '.' ) and (SRec.Name '..') then
szukaj(dir + srec.Name , list, mask);
res := FindNext(SRec);
end;
FindClose(SRec);
end;

  • ------------------- wywołanie wyszukiwania ------------------------------

procedure TForm1.Button4Click(Sender: TObject);
procedure DodajKawalek(Jaki: String);
var
list: TstringList;
ListItem : TListItem;
begin
ListItem:=lista.Items.Add; * listwiev !!!
ListItem.Caption:=jaki;
end;
var
list: TstringList;
n:integer;
begin
list:=TstringList.Create; lista
szukaj(combobox1.Path,list,'
.*'); *shellcombobox
for n:=0 to list.Count -1 do begin
begin
DodajKawalek(List.strings[n]);
end;
end;
list.Destroy; * list
end;

--
-= pozdrawiam Oskar =- (delphi 6 GG:2792614)

0

Każdy Item w Listview ma pole SubItems - dodaj tam wszelakie info (jako stringi), a ListView wyświetlaj jako Raport.--Vogel [Delphi 6 PE]

I TY możesz nauczyć się grać w bierki!

1 użytkowników online, w tym zalogowanych: 0, gości: 1