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 1868306
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:40:02+00:00 2026-05-17T06:40:02+00:00

I have a Process: Process pr = new Process(); pr.StartInfo.FileName = @wput.exe; pr.StartInfo.Arguments =

  • 0

I have a Process:

Process pr = new Process();
pr.StartInfo.FileName = @"wput.exe";
pr.StartInfo.Arguments = @"C:\Downloads\ ftp://user:dvm@172.29.200.158/Transfer/Updates/";
pr.StartInfo.RedirectStandardOutput = true;
pr.StartInfo.UseShellExecute = false;
pr.StartInfo.
pr.Start();

string output = pr.StandardOutput.ReadToEnd();

Console.WriteLine("Output:");
Console.WriteLine(output);

Wput is an ftp upload client.

At the moment when I run the process and begin the upload, the app freezes and the console output won’t show until the end. I guess the first problem is solvable by using a Thread.

What I want to do is start an upload, have it pause every so often, read whatever output has been generated (use this data do make progress bar etc), and begin again.

What classes/methods should I be looking into?

  • 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-17T06:40:02+00:00Added an answer on May 17, 2026 at 6:40 am

    You can use the OutputDataReceived event to print the output asynchronously. There are a few requirements for this to work:

    The event is enabled during asynchronous read operations on StandardOutput. To start asynchronous read operations, you must redirect the StandardOutput stream of a Process, add your event handler to the OutputDataReceived event, and call BeginOutputReadLine. Thereafter, the OutputDataReceived event signals each time the process writes a line to the redirected StandardOutput stream, until the process exits or calls CancelOutputRead.

    An example of this working is below. It’s just doing a long running operation that also has some output (findstr /lipsn foo * on C:\ — look for “foo” in any file on the C drive). The Start and BeginOutputReadLine calls are non-blocking, so you can do other things while the console output from your FTP application rolls in.

    If you ever want to stop reading from the console, use the CancelOutputRead/CancelErrorRead methods. Also, in the example below, I’m handling both standard output and error output with a single event handler, but you can separate them and deal with them differently if needed.

    using System;
    using System.Diagnostics;
    
    namespace AsyncConsoleRead
    {
        class Program
        {
            static void Main(string[] args)
            {
                Process p = new Process();
                p.StartInfo.FileName = "findstr.exe";
                p.StartInfo.Arguments = "/lipsn foo *";
                p.StartInfo.WorkingDirectory = "C:\\";
                p.StartInfo.UseShellExecute = false;
    
                p.StartInfo.RedirectStandardOutput = true;
                p.StartInfo.RedirectStandardError = true;
                p.OutputDataReceived += new DataReceivedEventHandler(OnDataReceived);
                p.ErrorDataReceived += new DataReceivedEventHandler(OnDataReceived);
    
                p.Start();
    
                p.BeginOutputReadLine();
    
                p.WaitForExit();
            }
    
            static void OnDataReceived(object sender, DataReceivedEventArgs e)
            {
                Console.WriteLine(e.Data);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 1 process that receives incoming connection from port 1000 in 1 linux
I have a process in erlang that is supposed to do something immediately after
I have a process in Linux that's getting a segmentation fault. How can I
I have a process in a website (Asp.net 3.5 using Linq-to-Sql for data access)
I have a process x that I want to check for leaks with valgrind
We have a process that needs to run every two hours. It's a process
I have two process and a shared memory zone, my workflow is like this.
Imagine I have a process that starts several child processes. The parent needs to
Suppose I have a process which spawns exactly one child process. Now when the
Does anyone have a process or approach to use for determining how to resove

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.