程序代码: |
Private Sub KillProcess(processName As String)
Dim myproc As New System.Diagnostics.Process()
'得到所有打开的进程
Try
For Each thisproc As Process In Process.GetProcessesByName(processName)
'找到程序进程,kill之。
If Not thisproc.CloseMainWindow() Then
thisproc.Kill()
End If
Next
Catch Exc As Exception
MessageBox.Show(Exc.Message)
End Try
End Sub
Public Shared Sub StopProcess(processName As String)
Try
Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName(processName)
For Each p As System.Diagnostics.Process In ps
p.Kill()
Next
Catch ex As Exception
Throw ex
End Try
End Sub
|
暂时没有评论
发表评论 - 不要忘了输入验证码哦! | |||
作者: | 用户:
密码: 注册? 验证: |
||
评论:
禁止表情 禁止UBB 禁止图片 识别链接 识别关键字 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
|||