发错关闭代码了
'杀掉进程
Public Sub killprogress(ByVal progressname As String) '为进程避免冲突,杀死垃圾进程
Dim pProcess() As Process
pProcess = Process.GetProcesses()
Dim i As Integer
For i = 0 To pProcess.Length() - 1
'Console.WriteLine(pProcess(i).ProcessName)
If (pProcess(i).ProcessName = progressname) Then '关闭
pProcess(i).Kill() '关闭进程
End If
Next
End Sub
'关闭应用程序
Private Sub closeexe()
If CheckEdit1.Checked Then
If MessageBox.Show("升级程序正要关闭主程序,请确认已经保存了当前数据,按取消将会在一分钟后提示您进行升级。", "系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = DialogResult.OK Then
PictureBox5.Image = Image.FromFile(down)
killprogress("人力资源管理")
killprogress("updateUI")
Else
runthread.Sleep(60000)
closeexe()
End If
Else
PictureBox5.Image = Image.FromFile(down)
killprogress("人力资源管理")
killprogress("updateUI")
End If
End Sub