C# Remote application execution
I'm trying to create some sort of remote application execution programs. The situation is that I have a script on a remote pc that I need to execute. Ideally I could do with being able to tell this remote pc to execute this script as though开发者_JAVA百科 I was at it locally.
If possible it would be executable without the need to login to the pc (such as sending login details etc). I'm going for using .net c#.
The best code is code that you don't have to write yourself. Take a look at PSExec from Microsoft (SysInternals). Assuming that you have common credentials with the remote machine (either by virtue of a domain login or the same password and username), it should "Just Work".
Windows Management Instrumentation (WMI) allows you to do just that. If you need .NET bindings for it, they are in the System.Management
namespace
I WOULD GO with what Rob or Daniel suggested, but if you want to do something dirty (don't) you could write a small service that you'd register on the remote PCs that would just watch for a specific trigger. For example, the service could periodically check a network drive for a file, a database for some parameters, etc.
But as I said previously, this is something I would do if I'd want something really temporary and wouldn't want to spend time to learn how to do it properly.
精彩评论