如何在新线程上调用Action?

时间:2014-03-13 21:04:37

标签: vb.net multithreading

在VB.NET中,使用无参数Action开始新线程的语法是什么?

1 个答案:

答案 0 :(得分:0)

"使用无参数操作"

启动新线程的语法是什么

以下是两个例子:

示例1:

Private Sub MyAction()
    [... Code goes here]
End Sub

Public Sub Test()
    Dim t As New Thread(AddressOf Me.MyAction)
    t.Start()
End Sub

示例2:

Dim t As New Thread(Sub() [... Code goes here])
t.Start()