[英]How can I start/stop applications on a different computer?
Is it possible for one C# (desktop) application to start and stop applications on another machine? 一个C#(桌面)应用程序是否可以在另一台计算机上启动和停止应用程序?
I don't mean in a malicious sense, or even over the internet. 我的意思不是恶意的,甚至不是通过互联网。 I have two computers in a room and I need an app on one to start (and then stop) and app on the other.
我在一个房间里有两台计算机,我需要一台应用程序来启动(然后停止),而另一台应用程序。
One half-formed route in my mind was to use an auxiliary program on the target computer, so I suppose I ought to point out that I am completely able to make any necessary changes to either machine. 我心中的一条半成型路线是在目标计算机上使用辅助程序,因此我想指出的是,我完全有能力对任一台计算机进行必要的更改。
If you can do changes there are so many possibilities! 如果您可以进行更改,那么就有很多可能性!
Most of the alternatives involve writing a small service that listens on the communication technique of your choice and then starts a process or does something else. 大多数替代方案涉及编写一个小型服务,该服务侦听您选择的通信技术,然后启动一个进程或执行其他操作。
An example using WMI is up on Code Project: 代码项目中提供了一个使用WMI的示例:
But probably in your case a simple PsExec.exe
call might be enough, eg 但是可能在您的情况下,简单的
PsExec.exe
调用就足够了,例如
Process.Start("psexec.exe", "\\remotehost -u user -p password calc.exe");
来自sysinternals的psexec.exe或使用Powershell 2.0和WMI
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.