Sub THandler() If Net_mang_Form.Prg_bar.Value = 100 Then Net_mang_Form.Prg_bar.Value = 10 Else Net_mang_Form.Prg_bar.PerformStep() End Sub
Private Sub uplod_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles uplod_btn.Click If Net_mang_Form.dev_nm Is Nothing OrElse Net_mang_Form.dev_nm.Trim = "" Then Dim MyFolderBrowser As New System.Windows.Forms.FolderBrowserDialog ' Descriptive text displayed above the tree view control in the dialog box MyFolderBrowser.Description = "Select the Folder" ' Sets the root folder where the browsing starts from 'MyFolderBrowser.RootFolder = Environment.SpecialFolder.MyDocuments ' Do not show the button for new folder MyFolderBrowser.ShowNewFolderButton = False Dim dlgResult As DialogResult = MyFolderBrowser.ShowDialog() If dlgResult = Windows.Forms.DialogResult.OK Then Net_mang_Form.snd_file_path = MyFolderBrowser.SelectedPath Net_mang_Form.snd_file_path = String.Concat(Net_mang_Form.snd_file_path, "\") Else MsgBox("Choose Upload File path before Continue..") Exit Sub End If End If '=================== Upload Process is going on ===================== Net_mang_Form.disp_Label.Text = "Uploading File ..." Net_mang_Form.Prg_bar.Visible = True Net_mang_Form.Prg_bar.Value = 0 'Net_mang_Form.prg_Timer.Interval = 30 'Net_mang_Form.prg_Timer.Start() Dim t As New System.Timers.Timer 'Dim t As New System.Windows.Forms.Timer AddHandler t.Elapsed, AddressOf THandler t.Interval = 50 t.Start() 'Net_mang_Form.upload_event() Me.uplod_btn.Enabled = False Windows.Forms.Application.DoEvents() '==================================================================== Dim chk As Integer = file_send(dev_id, dev_type, Net_mang_Form.snd_file_path, ip_addr & "#1206", contrl_id) '=================== Upload Process is finished ===================== Net_mang_Form.disp_Label.Text = "Done" t.Stop() Net_mang_Form.Prg_bar.Visible = False Me.uplod_btn.Enabled = True '==================================================================== If (chk = 1) Then MsgBox("Upload successful") Else MsgBox("Upload Fail.Check file_transfer_log.txt file") End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)