Solved

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

Posted on 2007-12-05
4
1,705 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I've been looking at this too hard.  Didn't even think about setting the textbox to the output.  Duh!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now