none
C# program execution over the internet RRS feed

  • Question

  • I am attempting to execute a C# program over the internet.  I am trying to do the following:

    (1) Initiate the execution of the program from a web page on a client computer.

    (2) I want the program to be executed on the server, while all resulting screen displays to be displayed on the client computer's screen.

    My question is - Is this doable?

    Tuesday, December 10, 2019 4:43 PM

Answers

  • Thanks Tim.  I appreciate all of the help.

    Jim Stateczny

    • Marked as answer by Jim Stateczny Thursday, January 16, 2020 5:27 PM
    Friday, December 13, 2019 5:15 PM
  • Hi Jim,

    It seems that your problem has been solved. If so, please click "Mark as answer" to the appropriate answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Timon

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jim Stateczny Thursday, January 16, 2020 5:26 PM
    Monday, December 16, 2019 1:36 AM

All replies

  • It is doable but not straightforward. You can write a web application that presents the page. Then, from the web application you use Process.Start to launch the program at the server, and you use the options in ProcessStartInfo to capture the Standard Output of the program. You then send this Standard Output to the page that the web application is displaying, using some mechanism such as SignalR if you need the output to change dynamically as the program executes.

    Note however that this will only work for a program that sends its results to the Standard Output (in other words, a Console application). You will not be able to run in this way a windowed desktop application.

    Tuesday, December 10, 2019 10:28 PM
    Moderator
  • The reason I asked this question, in the first place, was because I was able to execute this program from the iPad Pro 11 by logging into the server using Remote Desk Top.  Because of that, I was hoping there would be another way to make this work, without giving the remote user access to the entire server.  When I log into the server, using RDT. and execute the C# program, it appears perfectly on the iPad's screen.

    Jim Stateczny

    Thursday, December 12, 2019 7:07 PM
  • Right, but Remote Desktop is an immensely complicated app, both on the server side and the client side.

    What you're talking about here is a web server.  Your client would connect to a web server port, which can either be an existing web server, or a mini one built-in to your application.  As Alberto says, if you're talking about a console app, then the web server can run the app, capture its output, and send it to the client.  If it's a windowed app, then there's no way.  You would have to rewrite the app to output HTML, which can be sent to the client and re-rendered.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Friday, December 13, 2019 1:10 AM
  • Thanks Tim.  I appreciate all of the help.

    Jim Stateczny

    • Marked as answer by Jim Stateczny Thursday, January 16, 2020 5:27 PM
    Friday, December 13, 2019 5:15 PM
  • Hi Jim,

    It seems that your problem has been solved. If so, please click "Mark as answer" to the appropriate answer, so that it will help other members to find the solution quickly if they face a similar issue.

    Best Regards,

    Timon

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jim Stateczny Thursday, January 16, 2020 5:26 PM
    Monday, December 16, 2019 1:36 AM