Starting a process from a web application

I'm actually trying to start a process for winzip and zip the folder. I do this using the below code in vb.

Dim startInfo As New System.Diagnostics.ProcessStartInfo
Dim pStart As New System.Diagnostics.Process
Dim tempFileName As String
Try
    startInfo = New System.Diagnostics.ProcessStartInfo( _
    "c:\Program Files\WinZip\WINZIP32.EXE")
    startInfo.Arguments = " -a -r ""c:\test.zip"" c:\test"
    startInfo.UseShellExecute = False
    startInfo.WindowStyle = Diagnostics.ProcessWindowStyle.Normal

    pStart.StartInfo = startInfo
    'startInfo.WorkingDirectory = "c:\Program Files\WinZip"
    'startInfo.FileName = "WINZIP32.EXE"
    pStart.Start()
    pStart.WaitForExit()

Catch ex As Exception
    Throw
End Try

      

This works great when it pushes the Windows app button click event. But when the same thing is done in the button click event in the web application, I can see the process start in the machine's task manager. But it doesn't zip it up and close the app, and its winzip ui doesn't pop up ... But in very few machines it works fine. On most machines I ran into the problem and was also able to consistently reproduce the problem ...

But a similar thing, if I try to use 7z zip, it works fine with the web app itself ...

Please let me know if there is any solution or workaround for this ...

Thanks Vinod T.

0


source to share


2 answers


I believe the .Net framework has zip capabilities built in. I would try to use them first. Your mailer may not be running due to permissions on the web server.

Edit



I just checked and there seems to be limited zip support in System.IO.Compression. But according to this discussion , this may not be what you want. This discussion, however, mentions an article titled " Decompress Zip Files with Windows and C # Shell API ".

+1


source


This could be because IIS works like; try changing the app to start your identity to see if it works. Of course, winzip is a UI tool - you might find it helpful to use the command line zip utility ... pkzip ;-p



Personally, I would use ZipLib instead - this will allow you to manipulate zip files in managed code.

0


source







All Articles