在delhi中用ftp去連接另外一臺電腦
怎樣才能獲得另一臺電腦在fpt文件夾中的所有的文件標題內容

解决方案 »

  1.   

    procedure TForm1.Button1Click(Sender: TObject);
    var
            AFiles: TStringList;
            AFtp: TIdFtp;
    begin
            AFiles := TStringList.Create;
            AFtp := TIdFtp.Create(self);
            AFtp.Host := '192.168.1.1';
            AFtp.Password := 'test';
            AFtp.Username := 'test';
            AFtp.Connect();
            AFtp.List(AFiles,'*.*',True);
            Memo1.Lines.Clear;
            Memo1.Lines.AddStrings(AFiles);        AFtp.Disconnect;
            AFtp.Destroy;
            AFiles.Destroy;
    end;