我如何看待C#中的远程进程?

时间:2022-08-21 20:55:47

I want to know if a process is running in the current machine as a part of my application ,but my application is deployed in another machine.

我想知道一个进程是否作为我的应用程序的一部分在当前机器上运行,但我的应用程序部署在另一台机器上。

I'm using System.Diagnostics.Getprocessbyname but it looks for processes on the machine the application is deployed to. I want to know whether the process is running on my machine.

我正在使用System.Diagnostics.Getprocessbyname,但它会在部署应用程序的计算机上查找进程。我想知道该进程是否在我的机器上运行。

Is there a way to do this?

有没有办法做到这一点?

Note: This is edited by someone other than the question asker in an attempt to make it easier to understand. I have may not correctly captured their question..

注意:这是由提问者以外的人编辑,以使其更容易理解。我可能没有正确地抓住他们的问题..

1 个解决方案

#1


You can use

您可以使用

System.Diagnostics.Process.GetProcessesByName("processname", "mymachine");

#1


You can use

您可以使用

System.Diagnostics.Process.GetProcessesByName("processname", "mymachine");