我知道如何在VB.NET中通过标题名称来检测窗口,并且它工作正常
If p.MainWindowTitle.Contains("Registry") Then但是注册表编辑器在每种语言中都有不同的名称,那么我如何通过ProcessName检测"regedit.exe“呢?
我试过这样做,但似乎根本不起作用:
If p.ProcessName.Contains("regedit") Then
If p.StartInfo.FileName.Contains("regedit") Then那么我如何才能检测到它呢?
发布于 2020-08-13 17:35:20
您可以使用GetProcessesByName方法获取所有regedit.exe进程
System.Diagnostics.Process.GetProcessesByName("regedit")这将返回一个Process数组。
https://stackoverflow.com/questions/63392091
复制相似问题