This document is archived and information here might be outdated.  Recommended version.


IZipArchive.AddFile Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (System)  

IZipArchive.AddFile Method

Compresses a file and adds it to the archive.

[Visual Basic .NET]
Public Sub AddFile ( _
    ByVal inputFile As String _
)
[C#]
public void AddFile (
    string inputFile
);
[C++]
HRESULT AddFile(
  BSTR inputFile
);
[C++]

Parameters inputFile [in] inputFile is a parameter of type BSTR

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

Compresses and adds the specified file to the zip archive. Ensure the zip archive is open before using the AddFile method by either using the CreateArchive (if you just created an archive) or OpenArchive (if you are using a previously created archive) methods.

Note, you cannot use the AddFile method to add the contents of a directory to a zip archive.

See Also

IZipArchive Interface