Solved

How to display console output in an ASP.NET textbox?

Posted on 2007-12-05
4
1,729 Views
Last Modified: 2010-04-21
I have an ASP.NET (C#) webform that collects some data and passes it to a windows console program.  I'd like to be able to keep the console window from popping up and display it's output in a window on my webform.  Is this possible?  At the very least, I'd like to get the output to display in the web page.  Thank you!
0
Comment
Question by:jvalescu
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Abu Hamdan
ID: 20412413
Since your application is web, you cant call EXE on the client pc. its prevented fot security reasons. But there is a way by using hta files: http://msdn2.microsoft.com/en-us/library/ms536496.aspx

Its web based but when browsed by client you can do all things that is done by desktop app. like registry modifying, call exe ..etc
0
 

Author Comment

by:jvalescu
ID: 20412771
The console app is on the webserver, not the client pc.  I've tested with a simple console app that displays "Hello World!" and using  Response.Write(p.StandardOutput.ReadToEnd());, pops the console window for a second then displays "Hello World!" in the top left corner of my browser window.  I'd like that to go to a text box on my page.  Another acceptable solution would be to open another browser window for the output.  Any ideas?
0
 
LVL 11

Accepted Solution

by:
cmhunty earned 500 total points
ID: 20412937
I assume p is a process?

So if p.StandardOutput.ReadToEnd()  returns the string, why can't you just set the textbox value to this?
textbox1.Text = p.StandardOutput.ReadToEnd();

Would it not be worth pulling out the required functions from the console app into a separate library which can be called from both the console app and the website app?
0
 

Author Closing Comment

by:jvalescu
ID: 31412877
I've been looking at this too hard.  Didn't even think about setting the textbox to the output.  Duh!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question