是有这个问题,以前我也发现现过,楼主一说我倒要去看一ftp的源码了,我想应该是个BUG.

解决方案 »

  1.   

    程序如下
    procedure TForm1.NMFTP1Success(Trans_Type: TCmdType);
    begin
    case trans_type of
    cmddownload:statusbar1.SimpleText:='download success';
    cmdupload:statusbar1.SimpleText:='Upload success';
    end;
    end;//list button
    procedure TForm1.BitBtn1Click(Sender: TObject);
    var i:integer;
    begin
    screen.cursor:=crhourGlass;
    try
    nmftp1.parselist:=true;
    nmftp1.Vendor:=NMOS_AUTO;
    nmftp1.List;
    finally
    screen.cursor:=crdefault;
    end;
    end;//connect button
    procedure TForm1.BitBtn2Click(Sender: TObject);
    begin
    nmftp1.host:=edit3.text;
    nmftp1.port:=strtoint(edit4.text);
    nmftp1.timeout:=20000;
    nmftp1.userid:=edit5.text;
    nmftp1.password:=edit6.text;
    nmftp1.connect;
    end;//download button
    procedure TForm1.BitBtn9Click(Sender: TObject);
    begin
    nmftp1.mode(mode_image);
    nmftp1.Download('DTCARD.ASM','d:\download\DTCARD.ASM');
    end;
    procedure TForm1.NMFTP1Disconnect(Sender: TObject);
    begin
    if statusbar1 <>nil then
    statusbar1.SimpleText:='Disconnected';
    end;
    procedure TForm1.NMFTP1Failure(var Handled: Boolean; Trans_Type: TCmdType);
    begin
    case trans_type of
    cmddownload:statusbar1.SimpleText:='download failure';
    cmdupload:statusbar1.SimpleText:='Upload failure';
    end;
    end;
    end.
      

  2.   

    程序如下
    //list button
    procedure TForm1.BitBtn1Click(Sender: TObject);
    var i:integer;
    begin
    nmftp1.parselist:=true;
    nmftp1.Vendor:=NMOS_AUTO;
    nmftp1.List;
    memo1.lines.assign(nmftp1.ftpdirectorylist.name);
    end;
    //connect button
    procedure TForm1.BitBtn2Click(Sender: TObject);
    begin
    nmftp1.host:=edit3.text;
    nmftp1.port:=strtoint(edit4.text);
    nmftp1.userid:=edit5.text;
    nmftp1.password:=edit6.text;
    nmftp1.connect;
    end;
    //download button
    procedure TForm1.BitBtn9Click(Sender: TObject);
    begin
    nmftp1.mode(mode_image);
    nmftp1.Download('DTCARD.ASM','d:\download\DTCARD.ASM');
    end;
    procedure TForm1.NMFTP1Failure(var Handled: Boolean; Trans_Type: TCmdType);
    begin
    case trans_type of
    cmddownload:statusbar1.SimpleText:='download failure';
    cmdupload:statusbar1.SimpleText:='Upload failure';
    end;
    end;procedure TForm1.NMFTP1Success(Trans_Type: TCmdType);
    begin
    case trans_type of
    cmddownload:statusbar1.SimpleText:='download success';
    cmdupload:statusbar1.SimpleText:='Upload success';
    end;
    end;
    end.