`
kiki1120
  • 浏览: 307911 次
  • 性别: Icon_minigender_2
  • 来自: 上海
社区版块
存档分类
最新评论

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

    博客分类:
  • .Net
阅读更多

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

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics