0
嘿,這裏是我的腳本:線程使得我的程序沒有響應?
Private Sub UpdateThread()
Dim AppDir As String = Application.StartupPath()
My.Computer.Network.DownloadFile(MyUpdate.UpdateFetchURL, UpdateClass.WebUpdateZIP, True, True)
MyUpdate.ExtractArchive(UpdateClass.WebUpdateZIP, AppDir)
File.Delete(UpdateClass.WebUpdateZIP)
End Sub
我怎麼稱呼它:
Private Sub FetchUpdateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FetchUpdateButton.Click
FetchUpdateButton.Enabled = False
Dim trd As New Thread(AddressOf UpdateThread)
trd.IsBackground = True
trd.Start()
Do
ProgressBar1.Increment(5)
ProgressBar1.Increment(2)
Loop
End Sub
它完美地做了UpdateThread任務,但計劃只是掛起。而已。謝謝。