This works but why (running a process)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • active

    #1

    This works but why (running a process)

    I start a process, give it input and then tell it what to do with the
    output.

    I'm having trouble understanding what is happening.
    When I give it the input I expect it runs it.
    What is happing to the output at that point?

    When I connect StandardOutput to a stream nothing is reading the stream
    until some lines later.

    I can't picture what is happening - even though it is working.

    Can you enlighten me.

    Also, if I want to abort the process can I do that?


    Thanks



    First I start a process
    Dim StartInfo As New ProcessStartInf o

    Static myProcess As New Process

    StartInfo.FileN ame = "cmd"

    StartInfo.Redir ectStandardInpu t = True

    StartInfo.Redir ectStandardOutp ut = True

    StartInfo.Creat eNoWindow = True

    StartInfo.UseSh ellExecute = False

    myProcess.Start Info = StartInfo

    myProcess.Start ()

    Then I give it input

    Dim SWIn As System.IO.Strea mWriter = myProcess.Stand ardInput

    more code here

    Then I set the output

    Dim SROut As System.IO.Strea mReader = myProcess.Stand ardOutput

    more code here


Working...