Vb.net 检测regedit.exe是否打开
我知道如何在VB.NET中通过标题名来检测窗口,并且它可以正常工作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
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")