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 检测regedit.exe是否打开_Vb.net_Regedit - Fatal编程技术网

Vb.net 检测regedit.exe是否打开

Vb.net 检测regedit.exe是否打开,vb.net,regedit,Vb.net,Regedit,我知道如何在VB.NET中通过标题名来检测窗口,并且它可以正常工作 If p.MainWindowTitle.Contains("Registry") Then 但是注册表编辑器在每种语言中都有不同的名称,因此如何通过ProcessName检测“regedit.exe” 我试过那样做,但似乎根本不起作用: If p.ProcessName.Contains("regedit") Then If p.StartInfo.FileName.Contains

我知道如何在VB.NET中通过标题名来检测窗口,并且它可以正常工作

If p.MainWindowTitle.Contains("Registry") Then
但是注册表编辑器在每种语言中都有不同的名称,因此如何通过ProcessName检测“regedit.exe”

我试过那样做,但似乎根本不起作用:

If p.ProcessName.Contains("regedit") Then

If p.StartInfo.FileName.Contains("regedit") Then

那么如何检测它呢?

您可以使用以下方法获取所有
regedit.exe
进程:

这将返回一个由
进程
进程.GetProcesses()组成的数组。任何(函数(p)p.ProcessName.Contains(“regedit”)
对我来说都很好。请回答问题并提供答案。
System.Diagnostics.Process.GetProcessesByName("regedit")