[twsocket] Download file from FTP with ProgressBar in Delphi
Hi! I use FtpClient to download file from FTP-server. How can I show download progress in ProgressBar? -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download file from FTP with ProgressBar in Delphi
Hi Anton I think you just need to use the OnProgress event like this ... procedure TFTPDownloadForm.FTPProgress(Sender: TObject; Count: Integer; var Abort: Boolean); begin Abort := bCancel; // bCancel is a boolean set by clicking cancel button progDB.Position := Count; end; HTH Jeff -- Jeff Cook Aspect Systems Ltd www.aspect.co.nz + The Cooks Oasis www.cookislandsoasis.com Phone: +682 28 213 Skype: jeffraro -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Anton Nikulin Sent: Wednesday, 18 November 2009 4:27 a.m. To: twsocket@elists.org Subject: [twsocket] Download file from FTP with ProgressBar in Delphi Hi! I use FtpClient to download file from FTP-server. How can I show download progress in ProgressBar? -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download file from FTP with ProgressBar in Delphi
2009/11/18 Jeff Cook je...@aspect.co.nz Hi Anton I think you just need to use the OnProgress event like this ... procedure TFTPDownloadForm.FTPProgress(Sender: TObject; Count: Integer; var Abort: Boolean); begin Abort := bCancel; // bCancel is a boolean set by clicking cancel button progDB.Position := Count; end; HTH Jeff Thank you Jeff! procedure TFTPClientForm.FtpClient1Progress64(Sender: TObject; Count: Int64; var Abort: Boolean); begin ProgressBar1.Position:=Count; end; procedure TFTPClientForm.FtpClient1RequestDone(Sender: TObject; RqType: TFtpRequest; ErrCode: Word); begin ProgressBar1.Position:=0; end; ICS is the best! -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Download file from FTP with ProgressBar in Delphi
Anton Nikulin wrote: procedure TFTPClientForm.FtpClient1Progress64(Sender: TObject; Count: Int64; var Abort: Boolean); begin ProgressBar1.Position:=Count; end; Note that updating the progressbar too frequently may slow down overall application performance and will eat a lot of CPU power. This won't be visible on a slow DSL line but on fast connections. The FTPClient demo shows how to not update the progress label each time OnProgress64 fires. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be