Lista Folderów

0

Jak do ListBoxa dodać listę folderów np. z C:\Windows???

0

A nie możesz użyć innego komponetu??? np. DirectoryListBox.

0

No niby moge i zawsze tak robiłem ale teraz nie chce :) - to ma być do trojana :)

0

Przychodze na ratunek :P. Wstaw ta funkcje sobie gdzies [moze byc np. do kodu progsa]

function FindIt(Dir, Maska: String; Rodzaj: Integer) : TStringList;
var
Found : Integer;
SR: TSearchRec;
begin
Result := TStringList.Create;
try
if Dir[Length(Dir)]&lt&gt '\' then Dir:= Dir + '\';
Found := FindFirst(Dir + Maska, Rodzaj, SR);
while ( Found = 0 ) do
begin
if (SR.Name &lt&gt '.') and (SR.Name &lt&gt '..') then
Result.Add(Dir + SR.Name);
Found := FindNext(SR);
end;
finally
FindClose(SR);
end;
end;

[ i teraz uzycie moze troche trzepnite ale daje rezultat]

procedure TForm1.Button1Click(Sender: TObject);
var
Tmp: TStringList;
n: Integer;
begin
Tmp:=TStringList.Create;
Tmp.Text:=FindIt('C:\windows','.',faAnyFile and faDirectory).Text;
for n:=0 to Tmp.Count-1 do
begin
if DirectoryExists(Tmp.Strings[n]) then ListBox1.Items.Add(Tmp.Strings[n]);
end;
Tmp.Free;
end;

Z tym trzepnieciem to chodzi mi o to faAnyFile and faDirectory moze ktos wie jakie flagi ustawic zeby dawalo same katalogi bez plikow??--sys:&gt logout....

0

Ja jeszcze tyle dodam, aby w sekcji uses dodać FileCtrl, aby program działał poprawnie... Aha a tego trojana robisz na zasadzie klient - serwer tak?

0

DZIĘKI ZA POMOC!

PS. No... Client-Server.--Delphi 6

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