Home Forums .NET libraries Xceed Zip & Real-Time Zip for .NET XceedZip.PreservePaths not found

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20030 |

    Hi,

    I want to use XceedZip.PreservePaths option in .NET dll. This option is availabe in Activex dll

    Please help. 

     

    Imported from legacy forums. Posted by Ravi (had 857 views)

    User (Old forums)
    Member
    Post count: 23064

    It depends on the classes you use.  If you use the QuickZip class, then you can use the preservePaths parameter of one of the overloaded Zip() method to have the path preserved when constructing the zip archive.

    If you use the FileSystem classes (i.e. ZipArchive), there is no such property.  To preserve paths in this case, you need to use the CopyTo() method rather then the CopyFilesTo() method.

    e.g.:

        AbstractFile zip = new DiskFile( @”D:\Temp\Paths.zip” );

        ZipArchive archive = new ZipArchive( zip );

        AbstractFolder folder = new DiskFolder( @”D:\Temp\temp” );

        //This will keep paths

        folder.CopyTo( archive,

    true );

        //This will not keep paths

        folder.CopyFilesTo( archive,

    true, true );

     

    Imported from legacy forums. Posted by André (had 1286 views)

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