---
title: "VB.Net检查进程是否存在及关闭进程"
author: "kiki1120"
date: "2012-08-23T16:25:42Z"
tags: []
categories: ["编程语言"]
slug: "vb-net"
draft: false
lastmod: "2013-03-12T21:55:57Z"
id: 1659979
url: "https://mimmy.iteye.com/blog/1659979"
---

Dim i As Integer

Dim proc As Process()

 

'判断excel进程是否存在

If System.Diagnostics.Process.GetProcessesByName("excel").Length &gt; 0 Then

    proc = Process.GetProcessesByName("excel")

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

    For i=0 to proc.Length -1

        proc(i).Kill()

    Next

End If

proc = Nothing