Visual Basic .NET with Web Forms: session variables lost when shelling a process

M

MirkoGeest

(Webmaster: sorry, I posted this first at the General Software
Engineering category, but I think this goes here)

I'm using Visual Basic with Web Forms on .NET 2003 and I'm experiencing
a very weird problem:

When the user presses a button, the web application starts a shell
process to decompress a *.gz file with gzip.exe. All ok for now, I get
some data and send formatted data to the client browser.

When the client then does any ather action which is sent to the server
(postback), all session variables have disappeared!!

If you know a way to avoid loosing the session variables, or another
way to decompress a *.gz file without shelling a command line
application, please answer!!

I attach the shell code here:

Private Sub ShellWithRedirect(ByVal app As String, ByVal args As
String, ByVal workingDirectory As String)
Dim ShellProcess As New System.Diagnostics.Process
Try
ShellProcess.StartInfo.FileName = app
ShellProcess.StartInfo.Arguments = args
ShellProcess.StartInfo.UseShellExecute = False
ShellProcess.StartInfo.CreateNoWindow = True
ShellProcess.StartInfo.RedirectStandardError = True
ShellProcess.StartInfo.RedirectStandardOutput = True
ShellProcess.StartInfo.WorkingDirectory = workingDirectory
ShellProcess.Start() -'If I comment this line, Session
variables are maintained. If not commented, then I loose them all.-
ShellProcess.WaitForExit(5000)
Catch ex As Exception
Console.Write
ShellProcess.StandardOutput.ReadToEnd.ToString)
Console.Write
ShellProcess.StandardError.ReadToEnd.ToString)
Finally
ShellProcess.Dispose()
End Try
End Sub
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top