asp.net new process hangs

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
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top