This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IZ > IZipArchive Interface > IZipArchive.AddFile Method (ArcObjects .NET 10.4 SDK) |
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
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.