asp.net new process hangs

  • Thread starter Thread starter Scott
  • Start date Start date
S

Scott

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
.UseShellExecute = False
.FileName = "c:\plink.exe"
.Arguments = " -ssh -l myun -pw mypw
un@server ./myvnc start"
.RedirectStandardOutput = True
.RedirectStandardError = True
End With

' Execute the process
p.EnableRaisingEvents() = True
If p.Start() Then
p.WaitForExit(5)
mvarResults = p.StandardOutput.ReadToEnd()
End If
End Sub
 
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:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top