VB.Net检查进程是否存在及关闭进程
发布时间:2020-12-17 08:03:23 所属栏目:百科 来源:网络整理
导读: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
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 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |