您的位置:首页 > 编程语言 > VB

VB.Net检查进程是否存在及关闭进程

2013-12-25 16:15 197 查看
Dim i As Integer

Dim proc As Process()

'判断excel进程是否存在

If System.Diagnostics.Process.GetProcessesByName("excel").Length > 0 Then

proc = Process.GetProcessesByName("excel")

'得到名为excel进程个数,全部关闭

For i=0 to proc.Length -1

proc(i).Kill()

Next

End If

proc = Nothing
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: