Page 1 of 1

C# Running program on remote computer

Posted: Tue Dec 23, 2014 5:17 am
by Xaos
Hey guys. I'm looking for a way to run my console app in C# on one computer, but the actual program is ran on another computer. IE I open the file or hit "Run" in Visual Studio on computer1, the computer2 runs the program. I was looking online and found some stuff that may be applicable, but I didn't see a very clear answer.

Re: C# Running program on remote computer

Posted: Tue Dec 23, 2014 7:42 am
by Jackolantern
There are several different ways this can be done. You can either create a client/server setup and do it with sockets, or do it through RPC (Remote Procedure Call). There are still other ways to do it, such as integrating it into the web and using web services, etc., but it sounds like the first two options would be best.

Re: C# Running program on remote computer

Posted: Tue Dec 23, 2014 7:54 am
by Xaos
Thanks, I'm going to look into those. Sockets look promising.

Re: C# Running program on remote computer

Posted: Wed Dec 24, 2014 2:28 am
by Xaos
Follow up question. Say I finish the program, it has a nice GUI, etc. It's a desktop app or even a mobile app. I want the user to press "Go" on the GUI, it runs the program on a server/computer elsewhere. To accomplish this, would I just need to host the files on the computer/server, and then when someone pressed "Go" and called the program it would run the file on the server? Not sure how the dynamics of .Net works exactly, and in terms of the physical hardware it uses.

Re: C# Running program on remote computer

Posted: Wed Dec 24, 2014 5:13 pm
by Jackolantern
This would probably be best with a client/server setup. The client would have most of the program needed for running and displaying the interface. The server would have the logic needed to produce the data the client will display. Think like a webpage and the kind of code you need to have in Javascript for displaying the data, and the logic you need on the webserver for fulfilling AJAX requests to update the client display. It would be almost the same division, except instead of a webpage, you are using .NET desktop applications.