I'd like to run a console program from an ASP.NET page, pipe the output into a label or some other control, and have it updated dynamically as each Console.Writeline
happens.
How do I do that?
I'd like to run a console program from an ASP.NET page, pipe the output into a label or some other control, and have it updated dynamically as each Console.Writeline
happens.
How do I do that?
You can capture standard output from another program with the ProcessStartInfo
class: set RedirectStandardOutput
to true, and then read the programs output from the StandardOutput
property.
The data you read can be used for whatever purpose you wish.
Run the console app as a part of a web service (WCF with XML or JSON) and refresh periodically using ASP.NET AJAX
. This way, data transfer is minimal, a periodic query with occasional extra data in the reply.