大侠们 小弟问个简单线程问题(50分)

  • 主题发起人 主题发起人 meijingpengwork
  • 开始时间 开始时间
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';就开始报错了
 
控件冲突 试试看
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
673
import
I
I
回复
0
查看
515
import
I
I
回复
0
查看
686
import
I
后退
顶部