Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
3.4k views
in .NET FTP by (1.2k points)
I have the following upload method:

for (int h = 0; h < 10; h++)
{
ExFTPConnection Uploading_Connection_0 = new ExFTPConnection();
Uploading_Connection_0.LicenseOwner = license_owner;
Uploading_Connection_0.LicenseKey = license_key;
Uploading_Connection_0.ServerAddress = server_address;
Uploading_Connection_0.UserName = upload_username;
Uploading_Connection_0.Password = upload_password;
Uploading_Connection_0.UseGuiThreadIfAvailable = false;
Uploading_Connection_0.TransferNotifyInterval = transfer_interval;
Uploading_Connection_0.BytesTransferred += new BytesTransferredHandler(Uploading_Connection_0_BytesTransferred);
Uploading_Connection_0.Connect();

FileSegmentStream in_file_0 = new FileSegmentStream(local_file_name, chunk_size * h, chunk_size, FileMode.Open, FileAccess.Read);
//MessageBox.Show(@"/" + temp_file_name.Name + @"/" + temp_file_name.Name + String.Format(@"{0:D3}", i) + ".part");
Uploading_Connection_0.BeginUploadStream(in_file_0, @"/" + temp_file_name.Name + @"/" + temp_file_name.Name + String.Format(@"{0:D3}", h) + ".part", new AsyncCallback(Uploading_Connection_0_Complete), Uploading_Connection_0);
}


when the file is done uploading, I would like the Uploading_Connection_0_Complete method to return the h value for that connection. Is that possible?

2 Answers

0 votes
by (162k points)
The last argument of BeginUploadStream is an object, which can be anything you like. So you could pass 'h' in there for example, rather than Uploading_Connection_0.
0 votes
by (1.2k points)
Thanks, I see it.

Categories

...