本文介绍了使用单个DoWork子运行多个BackgroundWorkers的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

如何使用单个DoWork和progresschanged子运行多个BackgroundWorkers?
例如,
之类的东西

Hello,

how do i run multiple BackgroundWorkers with single DoWork and progresschanged sub?
for example, somthing like

dim ListOfTask as new list(Of string)

TestWorker1 = New System.ComponentModel.BackgroundWorker
TestWorker2 = New System.ComponentModel.BackgroundWorker
AddHandler TestWorker1.DoWork, AddressOf TestWorker_DoWork
AddHandler TestWorker2.DoWork, AddressOf TestWorker_DoWork

private sub TestWorker_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
if listoftask.count >1 then
''// do the work with a new worker
end if
end sub









will this work?

推荐答案


这篇关于使用单个DoWork子运行多个BackgroundWorkers的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 16:51