H
hongzenghuang
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure DLthread.downloadfile;
var
tstream:TFileStream;
name:string;
begin
idftp.Username:=form1.getuser(turl);
idftp.Password:=form1.getpsw(turl);
idftp.Host :=form1.geturlhost(turl);
idftp.Port :=21;
idftp.Connect(true);
name:=form1.geturlfilename(turl);
if FileExists(tfilename) then
tStream:=TFileStream.create(tfilename,fmOpenWrite) else
tStream:=TFileStream.create(tfilename,fmcreate);
idftp.SendCmd('rest '+inttostr(tstart),-1);
tstream.Seek(tstart,sofrombegin
ning);
idftp.OnWorkbegin
:=IDFTPWorkbegin
;
idftp.OnWork:= IdFTPWork;
try
idftp.Get(name,tstream,true);
finally
tstream.Free;
idftp.Free;
end;
end;
procedure DLthread.Execute;
begin
{ Place thread code here }
Synchronize(DownLoadFile);
//觉得这里用得不好 不过不在调怎么改
end;
var
tstream:TFileStream;
name:string;
begin
idftp.Username:=form1.getuser(turl);
idftp.Password:=form1.getpsw(turl);
idftp.Host :=form1.geturlhost(turl);
idftp.Port :=21;
idftp.Connect(true);
name:=form1.geturlfilename(turl);
if FileExists(tfilename) then
tStream:=TFileStream.create(tfilename,fmOpenWrite) else
tStream:=TFileStream.create(tfilename,fmcreate);
idftp.SendCmd('rest '+inttostr(tstart),-1);
tstream.Seek(tstart,sofrombegin
ning);
idftp.OnWorkbegin
:=IDFTPWorkbegin
;
idftp.OnWork:= IdFTPWork;
try
idftp.Get(name,tstream,true);
finally
tstream.Free;
idftp.Free;
end;
end;
procedure DLthread.Execute;
begin
{ Place thread code here }
Synchronize(DownLoadFile);
//觉得这里用得不好 不过不在调怎么改
end;