?
Solved

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

Posted on 2007-12-05
4
Medium Priority
?
1,776 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 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

864 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