Login  
Search All Forums
Dart Home | PowerTCP FTP for .NET | Custom Development Reply | PowerTCP FTP for .NET Topics | Forums   
AuthorForum: PowerTCP FTP for .NET
Topic: BeginPut and progress events
todd_schinell

From: San Diego, CA USA
Posts: 2
Member Since: 08/22/05
posted August 22, 2005 2:39 PM

If I use BeginPut to fire off a few file transfers at the same time, how can I get progress events for them from the ftp object? More clearly, how will I know which xfer thread is raising my progress event?

The way I'm currently doing it is to use a series of regular Put's each on their own threads and 1 ftp object per thread. I keep track of these in an array and set them all to the same progress_ftpn event, then I use the e.FileName to compare to the filenames in my list in order to figure out which one was making the event but this is messy for a few reasons. It'd be nice if there was some way to get info back to a Progress event the same way as with the "EndPut" event. Is this possible?

TIA to Tony Priest...
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted August 22, 2005 3:08 PM

The Ftp component has a Connection property that represents the underlying Tcp connection.

The Tcp component has a Tag property that can be any object.

So, what I would do is set the tag like so:

ftp1.Connection.Tag = "ftp1"; ftp1.BeginPut(localfile, remotefile, "ftp1");

then in progress I would do something like this:

string ControlName = (string)((Dart.PowerTCP.Ftp.Ftp)sender).Connection.Tag;

We probably should have a tag property for the Ftp control as well, but I tested this and it seems to work ok.


Reply | PowerTCP FTP for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX