W
WRainbug
Unregistered / Unconfirmed
GUEST, unregistred user!
请问如果用THTTPGET连续下载多个文件.
我从TStringList 读出MYURL, MYFILE, 然后用
for i := 0 to N do
begin
HTTPGet1.WaitThread := true;
HTTPGet1.URL := MYURL;
HTTPGet1.FileName := MYFILE;
HTTPGet1.GetFile;
end;
这样可以, 但是线程被占用, 程序其他地方没响应, 只能等着它下载完.
我后来在HTTPGET1的下载完毕事件里添加如下过程:作递归调用.
procedure TDownloadForm.DownNext(filelist : tstringlist; Current: Integer);
var
itemcount : Integer;
begin
if Current>= filelist.count then exit;
showmessage('download next file'); <<<<<<可以正常运行到这里.
HTTPGet1.WaitThread := false;
HTTPGet1.URL := MYURL;
HTTPGet1.FileName := MYFILE;
HTTPGet1.GetFile;
CurrentItemNum := CurrentItemNum + 1;
end;
递归没有成功, 请问各位有什么看法.....
谢谢了, 不知道的朋友, 帮顶一下帖子, 也送分感谢!
我从TStringList 读出MYURL, MYFILE, 然后用
for i := 0 to N do
begin
HTTPGet1.WaitThread := true;
HTTPGet1.URL := MYURL;
HTTPGet1.FileName := MYFILE;
HTTPGet1.GetFile;
end;
这样可以, 但是线程被占用, 程序其他地方没响应, 只能等着它下载完.
我后来在HTTPGET1的下载完毕事件里添加如下过程:作递归调用.
procedure TDownloadForm.DownNext(filelist : tstringlist; Current: Integer);
var
itemcount : Integer;
begin
if Current>= filelist.count then exit;
showmessage('download next file'); <<<<<<可以正常运行到这里.
HTTPGet1.WaitThread := false;
HTTPGet1.URL := MYURL;
HTTPGet1.FileName := MYFILE;
HTTPGet1.GetFile;
CurrentItemNum := CurrentItemNum + 1;
end;
递归没有成功, 请问各位有什么看法.....
谢谢了, 不知道的朋友, 帮顶一下帖子, 也送分感谢!