asp.net new process hangs

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

    asp.net new process hangs

    I am trying to write an asp.net web page that will spawn a
    third party .exe file and return the results back to my
    asp page. I am able to write a vb.net program that will
    do this just fine. I redirect the output to a msgbox and
    display it on the screen. However, when I put this as an
    asp.net web page, the process just hangs. I am able to do
    other processes from the same web page and get the
    results, but when I try to launch this one it just hangs.
    I was able to launch it as a seperate thread, then find
    the thread and kill it, but then I don't get the program
    results re-directed to std-out to display on a web page.
    Can anyone help?

    Here is a copy of the code that is being launched:

    Sub startprocess()

    Dim p As New Process

    ' Set up process to execute direct so that the
    output can be captured
    With p.StartInfo
    .CreateNoWindow () = False
    .UseShellExecut e = False
    .FileName = "c:\plink.e xe"
    .Arguments = " -ssh -l myun -pw mypw
    un@server ./myvnc start"
    .RedirectStanda rdOutput = True
    .RedirectStanda rdError = True
    End With

    ' Execute the process
    p.EnableRaising Events() = True
    If p.Start() Then
    p.WaitForExit(5 )
    mvarResults = p.StandardOutpu t.ReadToEnd()
    End If
    End Sub
  • S. Justin Gengo

    #2
    Re: asp.net new process hangs

    Scott,

    You might be confused about state management with a web app. Web
    applications are stateless. This means that the server creates a page
    object, then sends the html output that the page object creates to the
    client machine. The page object is then destroyed.

    What this means is that if you execute a thread the thread is actually
    executing on the web server and will it's actions such as a message box will
    never show up in the browser. It's a different environment all together.

    I hope this helps.

    --
    S. Justin Gengo, MCP
    Web Developer

    Free code library at:


    "Out of chaos comes order."
    Nietzche


    "Scott" <spiscitelli@ya hoo.com> wrote in message
    news:0dd301c36b e7$199d6a30$a60 1280a@phx.gbl.. .[color=blue]
    > I am trying to write an asp.net web page that will spawn a
    > third party .exe file and return the results back to my
    > asp page. I am able to write a vb.net program that will
    > do this just fine. I redirect the output to a msgbox and
    > display it on the screen. However, when I put this as an
    > asp.net web page, the process just hangs. I am able to do
    > other processes from the same web page and get the
    > results, but when I try to launch this one it just hangs.
    > I was able to launch it as a seperate thread, then find
    > the thread and kill it, but then I don't get the program
    > results re-directed to std-out to display on a web page.
    > Can anyone help?
    >
    > Here is a copy of the code that is being launched:
    >
    > Sub startprocess()
    >
    > Dim p As New Process
    >
    > ' Set up process to execute direct so that the
    > output can be captured
    > With p.StartInfo
    > .CreateNoWindow () = False
    > .UseShellExecut e = False
    > .FileName = "c:\plink.e xe"
    > .Arguments = " -ssh -l myun -pw mypw
    > un@server ./myvnc start"
    > .RedirectStanda rdOutput = True
    > .RedirectStanda rdError = True
    > End With
    >
    > ' Execute the process
    > p.EnableRaising Events() = True
    > If p.Start() Then
    > p.WaitForExit(5 )
    > mvarResults = p.StandardOutpu t.ReadToEnd()
    > End If
    > End Sub[/color]


    Comment

    Working...