Dim t As Thread = New Thread(New ParameterizedThreadStart(AddressOf CopyFiles))
t.IsBackground = True
t.Start(fileList)
Private Sub CopyFiles(ByVal myList As List(Of String))
拷贝文件代码
'线程切换更新UI线程UI的值
Me.BeginInvoke(New MyDelegate(AddressOf UpdateInfo), fileNowInt, srcfileName)
Thread.Sleep(2000)
End If
Catch
Continue For
End Try
Next
End Sub
Private Sub UpdateInfo(ByVal cnt As Integer, ByVal fileName As String)
pbUpdate.Value = cnt
lblUpdateFile.Text = fileName
lblUpdateFileCount.Text = String.Format("{1}/{0}", updateFileList.Count, cnt)
End Sub