本文介绍了检查开放进程,如果开放,则将其杀死的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在尝试添加此功能,以检查打开的进程并在这种情况下将其杀死.这是我到目前为止的内容:
Hi everyone,
I''m trying to add this functionality of checking for open processes and killing it if that is the case. This is what I have so far:
Process[] open_procs = Process.GetProcessesByName("PicoScope.exe");
if (open_procs.Length > 0)
{
open_procs.Kill();
}
在可用的open_procs命令中找不到Kill命令.
It''s not finding the Kill command within the open_procs available commands. Can someone shed some light as to how I can proceed with this?
推荐答案
Process[] open_procs = Process.GetProcessesByName("PicoScope.exe");
if( open_procs.Length > 0 )
{
foreach( var proc in open_procs )
{
proc.Kill();
}
}
这篇关于检查开放进程,如果开放,则将其杀死的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!