M
meijingpengwork
Unregistered / Unconfirmed
GUEST, unregistred user!
type
mythread = class(TThread)
indy : Tidftp;
procedure execute ;
override;
end;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Fthead : mythread;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Fthead := mythread.Create(true);
Fthead.Execute;
Fthead.FreeOnTerminate := true;
Fthead.Resume;
end;
{ mythread }
procedure mythread.execute;
begin
indy.Host := '192.168.21.12';
indy.Username := 'aaa';
indy.Password := 'aaa';
indy.Port :=2122;
indy.Connect();
indy.ChangeDir('/usr/backup/new4/M/');
indy.Put('E:/项目/gb/11eee/新建文件夹.rar','a.rar',true);
end;
点击button1就报错: 内存地址的错误,跟踪代码就是indy.Host := '192.168.21.12';就开始报错了
mythread = class(TThread)
indy : Tidftp;
procedure execute ;
override;
end;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Fthead : mythread;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
Fthead := mythread.Create(true);
Fthead.Execute;
Fthead.FreeOnTerminate := true;
Fthead.Resume;
end;
{ mythread }
procedure mythread.execute;
begin
indy.Host := '192.168.21.12';
indy.Username := 'aaa';
indy.Password := 'aaa';
indy.Port :=2122;
indy.Connect();
indy.ChangeDir('/usr/backup/new4/M/');
indy.Put('E:/项目/gb/11eee/新建文件夹.rar','a.rar',true);
end;
点击button1就报错: 内存地址的错误,跟踪代码就是indy.Host := '192.168.21.12';就开始报错了