(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 ShellWithRedire ct(ByVal app As String, ByVal args As
String, ByVal workingDirector y As String)
Dim ShellProcess As New System.Diagnost ics.Process
Try
ShellProcess.St artInfo.FileNam e = app
ShellProcess.St artInfo.Argumen ts = args
ShellProcess.St artInfo.UseShel lExecute = False
ShellProcess.St artInfo.CreateN oWindow = True
ShellProcess.St artInfo.Redirec tStandardError = True
ShellProcess.St artInfo.Redirec tStandardOutput = True
ShellProcess.St artInfo.Working Directory = workingDirector y
ShellProcess.St art() -'If I comment this line, Session
variables are maintained. If not commented, then I loose them all.-
ShellProcess.Wa itForExit(5000)
Catch ex As Exception
Console.Write
ShellProcess.St andardOutput.Re adToEnd.ToStrin g)
Console.Write
ShellProcess.St andardError.Rea dToEnd.ToString )
Finally
ShellProcess.Di spose()
End Try
End Sub
--
MirkoGeest
------------------------------------------------------------------------
Posted via
http://www.codecomments.com
------------------------------------------------------------------------