vb.net,等待一个线程结束的问题
想在MsgBox("d")前等待T2线程完成再向下执行,要怎么写?谢谢PublicClassForm1PrivateSubsetB()My.Computer.Networ...
想在 MsgBox("d")前等待T2线程完成再向下执行,要怎么写?谢谢
Public Class Form1
Private Sub setB()
My.Computer.Network.DownloadFile("ftp://61.234.126.242/JiaKuang/重大故障事件报告/信宜/44.doc", "d:\ss.doc")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Visible = True
Dim t2 As Threading.Thread
t2 = New Threading.Thread(AddressOf setB)
t2.Start()
'想在这里等T2线程结束再向下执行---------------
MsgBox("d")
End Sub
End Class 展开
Public Class Form1
Private Sub setB()
My.Computer.Network.DownloadFile("ftp://61.234.126.242/JiaKuang/重大故障事件报告/信宜/44.doc", "d:\ss.doc")
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Visible = True
Dim t2 As Threading.Thread
t2 = New Threading.Thread(AddressOf setB)
t2.Start()
'想在这里等T2线程结束再向下执行---------------
MsgBox("d")
End Sub
End Class 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询