Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 343993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:56:58+00:00 2026-05-12T10:56:58+00:00

The following code is working great in a normal console application: private void button1_Click(object

  • 0

The following code is working great in a normal console application:

    private void button1_Click(object sender, EventArgs e)
    { 
        Process process = new Process();
        process.StartInfo.FileName = @"a.exe";

        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.RedirectStandardInput = true;
        process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        process.StartInfo.CreateNoWindow = true;
        process.StartInfo.UseShellExecute = false;

        process.OutputDataReceived += new DataReceivedEventHandler(process_OutputDataReceived);

        process.Start();
        process.BeginOutputReadLine();
    }

    void process_OutputDataReceived(object sender, DataReceivedEventArgs e)
    {
        this.Invoke(new Action(delegate() { textBox2.Text += "\r\n" + e.Data; }));
    }

but In a web application, it starts ‘a.exe’, but dosen’t outputs to the textbox. How can I fix it? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:56:58+00:00Added an answer on May 12, 2026 at 10:56 am

    You need to remember the difference between web applications and console/WinForms applications. You’ve got to return a page to the client. At the moment you’re saying “tell me when the process writes out a line” but then immediately returning the page… by the time the process has written anything, the web page will already have rendered.

    You might want to either wait for the process to exit or at least wait for a few seconds. Bear in mind that the user won’t see anything while they’re waiting for the page to be returned.

    You can do event-like things using techniques like Comet, but that’s pretty complicated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is the following stored procedure code robust for multi-user application. It is working fine.
I'm trying to get the following code working: string url = String.Format(@SOMEURL); string user
Working with the following code, I need to return only records where the `point'
Why is the following code (in cocoa) not working? NSString *extension = [fileName pathExtension];
I have the following Clojure code and I'm not sure why it's not working:
I'm working with some old PHP code that has a lot of the following:
The following code works great in IE, but not in FF or Safari. I
The following code illustrates an object literal being assigned, but with no semicolon afterwards:
Following code, when compiled and run with g++, prints '1' twice, whereas I expect
The following code doesn't compile with gcc, but does with Visual Studio: template <typename

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.