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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:14:23+00:00 2026-05-20T11:14:23+00:00

I used Process() to execute a external file named test.exe. The test.exe only prints

  • 0

I used Process() to execute a external file named “test.exe”.

The “test.exe” only prints a string.
“abc \n \r xyz\n”

My goal is to get the string and turn each byte to corresponding ASCII code.

That is, I expect the outputs in my c# console are as below,
97 98 99 32 10 32 13 32 120 121 122 10

But when I used BeginOutputReadLine to get the output of test.exe, \n and \r were striped.

As a result, I only got
97 98 99 32 32 32 120 121 122

Finally, I don’t want to use synchronized ways like Read, ReadLine, and ReadToEnd.
Is there any way to get what I want??

Thanks!

Actually, I create a backgroundWorker to deal with external process test.exe
I have a proc_DataReceived and backgroundWorker_Build_ProgressChanged…

the related code as below
http://codepad.org/Gmq1XqXb

all code as below
http://codepad.org/k7VpWynu

(I’m new to stackoverflow. I pasted my code in codepad.org before finding out how to format code here.)

  • 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-20T11:14:23+00:00Added an answer on May 20, 2026 at 11:14 am

    If you use BeginOutputReadLine, the string won’t contain the “end of line” characters (or some of them).

    See Capture output from unrelated process for another way to capture output of another process. This would work better in your case since you can read the stream character by character.

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

Sidebar

Related Questions

hi i created a process in C# to execute an external program, i used
How do I check if a file is already used by another process from
I have an assembly that may be used by more than one process at
I have a string command I'd like to execute asynchronously while writing to its
I'm trying to execute a new process and read from its input stream in
I have a perl script which is used to process some data files from
I am getting the The process cannot the file X because it is being
I used threads in this code. but when I execute this code in shell,
I have a file collection (3000 files) in a FileInfoCollection. I want to process
The following throws an exception The process cannot access the file 'D:\MyDir\First.txt' because it

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.