Shell output problem (reprise)
ok....well i thought i had it down......but alas i was wrong....what i'm aiming to do is read output from a command shell. All the solutions i've seen so far revolved around
sr.ReadToEnd()
where sr is the streamreader of the redirected output from a Process. It turns out that this isn't what i need after all. what i need is something that will read each individual line and ReadToEnd doesn't do that
let me see if i can rephrase my problem....
when you go to a command prompt and get something like
c:\>
you then type something like
c:\> del temp.txt
but if the file is not there to begin with you will get the error
Could Not Find C:\temp.txt
what i want to do is read each line of the process to check whether this error occors and if it does....do something else (like c:\> edit temp.txt ). with ReadToEnd it seems (unless i'm misunderstanding somehow) that the process must be finished before you can do the reading. Hence the problem .... i need to read as the process executes
does anyone get where i'm comming from?
J