Xceed .NET Libraries Documentation
Remove method

Welcome to Xceed .NET, .NET Standard and Xamarin Libraries! > Basic Concepts > The Quick classes > Quick classes versus FileSystem > Remove method

Xceed Zip for .NET gives you the possibility to remove files and folders from a zip file. For more information, you can refer to the Removing files from a zip file and Removing items from a zip file topics.

QuickZip Example

The following example demonstrates how to remove all files that begin with "xceed" from a zip file that contains various files using the static Remove method of the QuickZip class.

VB.NET Copy Code

Imports Xceed.Zip

QuickZip.Remove( "d:\test\files.zip", True, "xceed*" )

C# Copy Code

using Xceed.Zip;

QuickZip.Remove( "d:\\test\\files.zip", true, "xceed*" );

FileSystem

The following example demonstrates how to remove a file from within a zip file using the FileSystem object model.

VB.NET Copy Code

Imports Xceed.Zip
Imports Xceed.FileSystem

Dim f As New ZippedFile( New DiskFile( "c:\test.zip" ), "file.txt" )

If file.Exists Then
  file.Delete()
End If

C# Copy Code

using Xceed.Zip;
using Xceed.FileSystem;

ZippedFile f = new ZippedFile( new DiskFile( "c:\\test.zip" ), "file.txt" );

if( file.Exists )
  file.Delete();

For more information, you ca refer to the Removing files from a zip file and Removing items from a zip file topics.