FilePassword Property
This property specifies the case-sensitive password used to encrypt or decrypt the current file.
Syntax
ANSI (Cross Platform) char* GetFilePassword(int iFileIndex);
int SetFilePassword(int iFileIndex, const char* lpszFilePassword); Unicode (Windows) LPWSTR GetFilePassword(INT iFileIndex);
INT SetFilePassword(INT iFileIndex, LPCWSTR lpszFilePassword);
- (NSString*)filePassword:(int)fileIndex; - (void)setFilePassword:(int)fileIndex:(NSString*)newFilePassword;
#define PID_ZIP_FILEPASSWORD 21 IPWORKSZIP_EXTERNAL void* IPWORKSZIP_CALL IPWorksZip_Zip_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal); IPWORKSZIP_EXTERNAL int IPWORKSZIP_CALL IPWorksZip_Zip_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal); IPWORKSZIP_EXTERNAL int IPWORKSZIP_CALL IPWorksZip_Zip_CheckIndex(void *lpObj, int propid, int arridx);
Default Value
""
Remarks
This property specifies the case-sensitive password used to encrypt or decrypt the current file. If set to an empty string, no password is used.
For archives that have multiple files with the same password, you may use the Password property instead of the Password property of the Files collection. You may also use FilePasswordRequired property to see if a file requires a password after an archive has been scanned.
In this release, streaming out of encrypted archives is not supported. When compressing, WriteToProgressEvent must be set to false if Password is set.
Example (Compressing an Archive)
ZipControl.ArchiveFile = "c:\test.zip" ZipControl.RecurseSubdirectories = true ZipControl.IncludeFiles("c:\foo\*") ZipControl.Password = "nsoftware" ZipControl.Compress()
The FileIndex parameter specifies the index of the item in the array. The size of the array is controlled by the FileCount property.
This property is not available at design time.
Data Type
String