I am trying to display the file download progress on a .net form. I'm using C# .NET 2.0. I have a form with progress controls on it. I have encapsulated the FTPConnection object in my own FTPManager Class of which I pass an instance to my progress form. I create a backgroundworker object on my form and in the dowork function of the backgroundworker I call ftpconnection.download. I handle the bytes transferred event in the the ftpConnection object.
I use a delegate to update the controls on my form.
Here are the problems I'm having. Any suggestions will be welcome.
1) I noticed that when I call ftpConnection from my DoWork function, my DoWork function will not continue until the file is completely downloaded. this locks out the cancel button on my form. What is the recommended way to laucnh the ftpconnection.Download command asynchrounsly?
2) I've noticed that after a while the progress controls on my form will "freeze" (not update) but the file is still being transferred and I am still getting the bytesTransferred event. Is this an improper use of the FTPconnection object or is this a windows threading problem that I need to work out?
thanks,
Ira Idelson