Click here to Skip to main content
15,907,874 members
Home / Discussions / C#
   

C#

 
QuestionRe: C# code to triple a number Pin
CPallini8-May-08 3:20
mveCPallini8-May-08 3:20 
AnswerRe: C# code to triple a number Pin
Osten8-May-08 4:34
Osten8-May-08 4:34 
GeneralRe: C# code to triple a number Pin
laserbaronen8-May-08 4:36
laserbaronen8-May-08 4:36 
GeneralRe: C# code to triple a number Pin
Osten8-May-08 4:39
Osten8-May-08 4:39 
GeneralRe: C# code to triple a number Pin
laserbaronen8-May-08 4:41
laserbaronen8-May-08 4:41 
QuestionCMD.EXE from C# .net Pin
cristi_alonso8-May-08 1:34
cristi_alonso8-May-08 1:34 
AnswerRe: CMD.EXE from C# .net Pin
natsuyaki8-May-08 2:11
natsuyaki8-May-08 2:11 
QuestionmyProcess.StandardOutput Issue Pin
Harvey Saayman8-May-08 1:22
Harvey Saayman8-May-08 1:22 
Hey guys...

i have an console app that calls a different console app, im trying to get the result of the 2nd app printed in the 1st app.

heres my current code

Process myProcess = new Process();

myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;

myProcess = Process.Start("ring.exe"); //ring.exe is a console app that only prints "ringer rang" to the console

Console.WriteLine("Started 1st process --> Waiting............ ");
myProcess.WaitForExit();

StreamReader sr = myProcess.StandardOutput; // error occurs here 
Console.WriteLine("Finnished 1st process ---> output:");
Console.WriteLine(sr.ReadToEnd());


im getting the following error at runtime "StandardOut has not been redirected or the process hasn't started yet."

any ideas what im doing wrong?

thanx

Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
think BIG and kick ASS
you.suck = (you.passion != Programming)

AnswerRe: myProcess.StandardOutput Issue Pin
natsuyaki8-May-08 1:45
natsuyaki8-May-08 1:45 
QuestionPen Drive Pin
Bhim Prakash Singh8-May-08 0:53
Bhim Prakash Singh8-May-08 0:53 
AnswerRe: Pen Drive Pin
Christian Graus8-May-08 1:13
protectorChristian Graus8-May-08 1:13 
AnswerRe: Pen Drive Pin
Spunky Coder8-May-08 1:13
Spunky Coder8-May-08 1:13 
QuestionSending a E-mail in C# Pin
imnotso#8-May-08 0:21
imnotso#8-May-08 0:21 
AnswerRe: Sending a E-mail in C# Pin
N a v a n e e t h8-May-08 0:28
N a v a n e e t h8-May-08 0:28 
GeneralRe: Sending a E-mail in C# Pin
imnotso#8-May-08 0:47
imnotso#8-May-08 0:47 
GeneralRe: Sending a E-mail in C# Pin
imnotso#8-May-08 1:09
imnotso#8-May-08 1:09 
GeneralRe: Sending a E-mail in C# Pin
Christian Graus8-May-08 1:11
protectorChristian Graus8-May-08 1:11 
GeneralRe: Sending a E-mail in C# Pin
imnotso#8-May-08 1:43
imnotso#8-May-08 1:43 
GeneralRe: Sending a E-mail in C# Pin
Christian Graus8-May-08 1:48
protectorChristian Graus8-May-08 1:48 
GeneralRe: Sending a E-mail in C# Pin
imnotso#8-May-08 1:57
imnotso#8-May-08 1:57 
GeneralRe: Sending a E-mail in C# Pin
Christian Graus8-May-08 2:17
protectorChristian Graus8-May-08 2:17 
GeneralRe: Sending a E-mail in C# Pin
N a v a n e e t h8-May-08 2:59
N a v a n e e t h8-May-08 2:59 
GeneralRe: Sending a E-mail in C# Pin
imnotso#8-May-08 3:14
imnotso#8-May-08 3:14 
GeneralRe: Sending a E-mail in C# Pin
N a v a n e e t h8-May-08 3:27
N a v a n e e t h8-May-08 3:27 
AnswerRe: Sending a E-mail in C# Pin
RedHotFunk8-May-08 13:57
RedHotFunk8-May-08 13:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.