我有这段代码:
Public Sub Submit(
ByVal reasonId As Integer,
ByVal email As String,
ByVal message As String
)
'[Argument validation code here]
EmailController.sendMail(reasonId, email, message)
End Sub
我想在新线程中关闭它,以便在创建并启动线程后Submit()
返回。
在C#中,我可以这样做:
new Thread(() => {
EmailController.sendMail(reasonId, email, message)
}).Start();
我如何在VB.NET中执行此操作?
答案 0 :(得分:3)
new Thread(Sub() EmailController.sendMail(reasonId, email, message)).Start()