Uploading Progress Bar
-
Hey i have been trying to use this[^] code project article. I want to use this article to show the progress of my uploading process. Unfortunatley i am unable to get the progress bar to increase as i am using a separate class to upload my files which implements from an interface and i am having trouble incrementing the counter
i
which i have declared globally. my code is below from using this articlePrivate Sub btnPublish_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPublish.Click Dim Progress As New ProgressWindow Progress.Text = "Work" System.Threading.ThreadPool.QueueUserWorkItem(New System.Threading.WaitCallback(AddressOf PublishingFiles), Progress) Progress.ShowDialog() End Sub Private Sub PublishingFiles(ByVal status As Object) Dim callback As ProgressCallback = CType(status, ProgressCallback) Try callback.Begin(0, 100) Dim i As Integer = 0 While i < 100 callback.SetText(String.Format("Performing op: {0}", i)) callback.StepTo(i) If callback.IsAborting Then Return End If ''''''''''''''MY CODE''''''''''''''' strPublisher = tbPublisher.Text strDateTime = tbDateTime.Text If cmboSelection.Text = "Network Location" Then Dim SMB As New SMBRepository With SMB strIntialFolder = strPathSMB + "\" + SMB.AddXMLDeclaration().attributes(0).text + "\" .CreateDirectory(strIntialFolder) .CreateFolderStructure(SMB.AddXMLDeclaration(), strIntialFolder, objRepository) .TransferDocumentIndex() End With ElseIf cmboSelection.Text = "FTP Transfer" Then Dim FTP As New FTPRepository With FTP strIntialFolder = FTP.AddXMLDeclaration().attributes(0).text .Connect() .CreateFolderStructure(FTP.AddXMLDeclaration(), strIntialFolder, objRep