using WinZip32 in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nilam2477
    New Member
    • Feb 2008
    • 38

    using WinZip32 in C#

    i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
  • Nilam2477
    New Member
    • Feb 2008
    • 38

    #2
    using WinZip32 in C#

    The command line prompt for running winzip. The below command zips "1.txt" file into "zippy.zip"
    C:\Program Files\WinZip>wi nzip32.exe -min -a D:zippy.zip D:\\1.txt

    I want to do this programatically using C# using Process.Start() . I have trouble specifing the parameters for winzip exe. If i give only the exe name as below winzip application opens
    System.Diagnost ics.Process.Sta rt("C:\\Progra m Files\\WinZip\\ winzip32.exe");

    When i try giving the parameters(file name etc) as below it gives an error at run time "The system cannot find the file specified"
    System.Diagnost ics.Process.Sta rt("C:\\Progra m Files\\WinZip\\ winzip32.exe -min -a D:zippy.zip D:\\1.txt");

    I'm not sure if there is any problem with double quotes "". How can i specifiy the paramters? Please help

    Comment

    • balame2004
      New Member
      • Mar 2008
      • 142

      #3
      Originally posted by Nilam2477
      i need to zip the files/folder. How can i use winzip32.exe in C# code to programatically zip the files or folder. If you could provide some sample code that would be great. Thanks
      Hi,

      .NET framework 2.0 introduced a new class entitled GZipStream that allows you to do simple compressing and decompressing actions.

      Tutorials for using this class are available at:

      http://www.geekpedia.c om/tutorial190_Zip ping-files-using-GZipStream.html

      http://www.geekpedia.c om/tutorial191_Unz ipping-compressed-files-using-GZipStream.html

      Regards,
      Balaji U

      Comment

      • Plater
        Recognized Expert Expert
        • Apr 2007
        • 7872

        #4
        I have merged the two threads. Please do not double post your questions.

        MODERATOR

        Comment

        • Nilam2477
          New Member
          • Feb 2008
          • 38

          #5
          I tried to use GZipStream class to compress the files. But when i tried to unzip using WinZip32.exe it dint work. There was an error message "Cannot open file it does not appear to be a valid archive". Does this mean that i cannot using WinZip utility to unzip the files which are compressed using GZipStream. Is there any other alternative?

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            I have not had troubles using winzip to unzip archives made by GZipStream.

            Comment

            Working...