idftp modez new bug

Giganews Newsgroups
Subject: idftp modez new bug
Posted by:  Theart (nyxsn…@21cn.com)
Date: Thu, 16 Apr 2009

procedure TForm1.Button1Click(Sender: TObject);
var
    LCompressor: TIdCompressorZLib;
begin
    try
        LCompressor := TIdCompressorZLib.Create (nil);
        try
            IdFTP1.Username :='zhuixin';
            IdFTP1.Password :='zhuixin';
            IdFTP1.Host := '218.15.153.134';
            IdFTP1.PassIve:=True; // this ..........
            IdFTP1.TransferTimeout := 3000;
            IdFTP1.Compressor := LCompressor;

            IdFTP1.Connect;
            try
                IdFTP1.TransferMode := dmDeflate;
                IdFTP1.Get('/interface.pack', 'C:\1\interface.pack', False,
True);  //  non-disconnect exceptions to be raised back to the caller.
            finally
                IdFTP1.Disconnect;
            end;
        finally
            LCompressor.Free;
        end;
    except
        ShowMessage('error');
        Exit;
    end;
    ShowMessage('ok');
end;

Replies