c# - Use BeginOutputReadLine when the process output newline or return -
i used process() execute external file named "test.exe".
the "test.exe" prints string. "abc \n \r xyz\n"
my goal string , turn each byte corresponding ascii code.
that is, expect outputs in c# console below, 97 98 99 32 10 32 13 32 120 121 122 10
but when used beginoutputreadline output of test.exe, \n , \r striped.
as result, got 97 98 99 32 32 32 120 121 122
finally, don't want use synchronized ways read, readline, , readtoend. there way want??
thanks!
actually, create backgroundworker deal external process test.exe have proc_datareceived , backgroundworker_build_progresschanged...
the related code below
http://codepad.org/gmq1xqxb
all code below
http://codepad.org/k7vpwynu
(i'm new stackoverflow. pasted code in codepad.org before finding out how format code here.)
if use beginoutputreadline, string won't contain "end of line" characters (or of them).
see capture output unrelated process way capture output of process. work better in case since can read stream character character.
Comments
Post a Comment