Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何终止所有打开的powerpoint进程?_Vb.net - Fatal编程技术网

Vb.net 如何终止所有打开的powerpoint进程?

Vb.net 如何终止所有打开的powerpoint进程?,vb.net,Vb.net,我试图杀死所有打开的powerpoint进程,但我编写的代码只杀死一个打开的进程 '-- get a collection of processes running Dim foo() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses '-- go through each one looking for the internet explorer name For Ea

我试图杀死所有打开的powerpoint进程,但我编写的代码只杀死一个打开的进程

    '-- get a collection of processes running
    Dim foo() As System.Diagnostics.Process = System.Diagnostics.Process.GetProcesses
    '-- go through each one looking for the internet explorer name
    For Each temp As Diagnostics.Process In foo

        'For Word Files opened in Office
        If temp.ProcessName = "POWERPNT" Then
            temp.Kill() '-- if I find it, kill it.
            '                Exit For '-- exit the for loop
        End If

您只能找到
POWERPNT.exe的单个实例,因为

Word(Winword.exe)、Excel(Excel.exe)和Microsoft Access(MSAccess.exe)的多个实例可以同时运行。因此,这些服务器被定义为单用途(多实例)服务器。在任何给定时间只能运行一个PowerPoint实例(Powerpnt.exe)。因此,PowerPoint是一个多用途(单实例)服务器


阅读完整的文档。

您只能找到
POWERPNT.exe的单个实例,因为

Word(Winword.exe)、Excel(Excel.exe)和Microsoft Access(MSAccess.exe)的多个实例可以同时运行。因此,这些服务器被定义为单用途(多实例)服务器。在任何给定时间只能运行一个PowerPoint实例(Powerpnt.exe)。因此,PowerPoint是一个多用途(单实例)服务器

阅读完整的文档。

试试看

Dim foo() as process = Process.GetProcessByName("POWERPNT")

For Each temp As Process In foo

    temp.Kill()

Next
试一试


谢谢-很有魅力。请注意,它是GetProcessesByNameThank,它的工作方式很有魅力。请注意,它是getProcessByName