procedure TForm1.AddDownload(const AURL, AFileName: string); var info: TclDownloadInfo; begin info := TclDownloadInfo.Create(AURL, AFileName); lbDownloads.Items.AddObject(info.Display, info); end; procedure TForm1.StartDownloads; var i: Integer; begin for i := 0 to lbDownloads.Items.Count - 1 do begin if (TclDownloadInfo(lbDownloads.Items.Objects[i])).Status = dsReady then begin FThreadPool.QueueWorkItem(TclDownloadWorkItem.Create (TclDownloadInfo(lbDownloads.Items.Objects[i]), clCookieManager1)); end; end; end; procedure TclDownloadWorkItem.Execute(AThread: TThread); var http: TclHttp; stream: TStream; begin try http := nil; stream := nil; try http := TclHttp.Create(nil); http.CookieManager := FCookies; stream := TFileStream.Create(FInfo.FileName, fmCreate); http.Get(FInfo.URL, stream); finally stream.Free(); http.Free(); end; except //ChangeStatus(dsError); end; end;
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add admin@clevercomponents.com to your trusted senders list in your email software.