Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET question on XceedZipLib.XceedCompression upgrade to .net

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20538 |
     We currently use vb XceedZipLib.XceedCompression Xceed Zip Compression Library to un-compress data as following 
     
        Set objZIP = New XceedZipLib.XceedCompression
        With objZIP
            .License gstrXceedLicense
            .CompressionLevel = xclHigh
            .EncryptionPassword = “xxxx”
            lngError = .Uncompress(Content, vntZIP, True)
        End With
     
    Is there any Xceed production can be used to do that same job on c# .net 4.5 environment? If so, any sample code? 

    Imported from legacy forums. Posted by Jax (had 577 views)

    Diane [Xceed]
    Moderator
    Post count: 1353

    Hi Jax,

    Using Xceed Zip for .NET, you can decompress data that was compressed with Zip ActiveX’s XceedCompression with the following code:

       MemoryStream sourceStream = new MemoryStream( compressedData );
     
       using( XceedCompressedStreamEx xceedCompression = new XceedCompressedStreamEx( sourceStream, “your password” ) )
       {
          using( FileStream destinationStream = new FileStream( @”d:\data.txt”, FileMode.OpenOrCreate ) )
          {
             // 32K at at time.
             byte[] buffer = new byte[ 32768 ];
             int bytesRead = 0;
     
             // Loop until we have nothing more to read from the source stream.
             while( ( bytesRead = xceedCompression.Read( buffer, 0, buffer.Length ) ) > 0 )
             {
                destinationStream.Write( buffer, 0, bytesRead );
             }
          }
       }

    XceedCompressedStreamEx documentation:
    http://doc.xceedsoft.com/products/XceedFileSystem/#topic527.html

    Adapted from this:
    http://doc.xceedsoft.com/products/XceedFileSystem/#topic175.html

    Imported from legacy forums. Posted by Diane [Xceed] (had 663 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.