主题:求助—请各位老大帮我看看,为什么运行的时候总是出错!
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdFTP, Buttons;
type
TftpForm = class(TForm)
ListBox1: TListBox;
host: TLabel;
hostEdit: TEdit;
port: TLabel;
portEdit: TEdit;
userid: TLabel;
useridEdit: TEdit;
password: TLabel;
passwordEdit: TEdit;
XPManifest1: TXPManifest;
myFTP: TIdFTP;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ftpForm: TftpForm;
implementation
{$R *.dfm}
procedure TftpForm.BitBtn1Click(Sender: TObject);
begin
myftp.Host:=trim(hostedit.Text);
myftp.Port:=strtoint(portedit.Text);
myftp.Name:=trim(useridedit.Text);
myftp.Password:=trim(passwordedit.Text);
myftp.Connect;
end;
procedure TftpForm.BitBtn2Click(Sender: TObject);
begin
myftp.Free;
end;
procedure TftpForm.FormCreate(Sender: TObject);
begin
ftpform.Caption:='myftp';
end;
end.
[img]http://bbs.txwm.com/UploadFile/2007-6/2007620203512795.jpg[/img]
[img]http://bbs.txwm.com/UploadFile/2007-6/200762020352095.jpg[/img]
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, XPMan, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdFTP, Buttons;
type
TftpForm = class(TForm)
ListBox1: TListBox;
host: TLabel;
hostEdit: TEdit;
port: TLabel;
portEdit: TEdit;
userid: TLabel;
useridEdit: TEdit;
password: TLabel;
passwordEdit: TEdit;
XPManifest1: TXPManifest;
myFTP: TIdFTP;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
ftpForm: TftpForm;
implementation
{$R *.dfm}
procedure TftpForm.BitBtn1Click(Sender: TObject);
begin
myftp.Host:=trim(hostedit.Text);
myftp.Port:=strtoint(portedit.Text);
myftp.Name:=trim(useridedit.Text);
myftp.Password:=trim(passwordedit.Text);
myftp.Connect;
end;
procedure TftpForm.BitBtn2Click(Sender: TObject);
begin
myftp.Free;
end;
procedure TftpForm.FormCreate(Sender: TObject);
begin
ftpform.Caption:='myftp';
end;
end.
[img]http://bbs.txwm.com/UploadFile/2007-6/2007620203512795.jpg[/img]
[img]http://bbs.txwm.com/UploadFile/2007-6/200762020352095.jpg[/img]