Frequently Asked Questions

ProgressBar fails to update when using Blocking mode. (.Net components)

When using .NET components with Blocking property set to True, ProgressBar you have put in Progress event may seem to be idle during the fire transfer because you must synchronize with main thread (using Invoke/BeginInvoke) and update ProgressBas from the main thread. However - main thread is blocked (due to your Blocking = True setting) and nothing happens until main thread is released (after file transfer is finished). Although this isn\'t directly components fault, the workaround to enable ProgressBar to be updated would be to move the code into a separate thread so the main one doesn\'t get blocked.
This can be achieved by using the code similiar to this:
------------------------------ ---------------------------------
Private Sub StartThread()
sftp1.Hostname = "your_host"
sftp1.Blocking = True
sftp1.Login = "your_login"
sftp1.Password = "your_pass"
sftp1.PutFile(localpath, remotepath)
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim myThreadStart As New System.Threading.Thread(AddressOf StartThread)
End Sub

 Last updated Fri, Nov 8 2013 12:00am

Please Wait!

Please wait... it will take a second!