Dart.PowerTCP.Zip Namespace > Archive Class : Password Property |
<DefaultValueAttribute()> <DescriptionAttribute("Sets the default Password for zipping or unzipping, if not set on the ArchiveItem.")> <CategoryAttribute("Archive")> Public Property Password As String
[DefaultValue()] [Description("Sets the default Password for zipping or unzipping, if not set on the ArchiveItem.")] [Category("Archive")] public string Password {get; set;}
[DefaultValue()] [Description("Sets the default Password for zipping or unzipping, if not set on the ArchiveItem.")] [Category("Archive")] public: __property string* get_Password(); public: __property void set_Password( string* value );
[DefaultValue()] [Description("Sets the default Password for zipping or unzipping, if not set on the ArchiveItem.")] [Category("Archive")] public: property String^ Password { String^ get(); void set ( String^ value); }
When creating a compressed archive, this property will be propagated to the ArchiveItem.Password property of each individual ArchiveItem object in the collection. For customizing the password for an individual item in the archive, use the ArchiveItem.Password property of the ArchiveItem object.
To determine if a password is required when decompressing an archive, check the ArchiveItem.Encryption property.
If a password is specified, but encryption is Encryption.None, an Exception event will be raised.
Note that some unzipping utilities may not be able to handle a password with more than 99 characters.
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Zip" ' at the top of your class. ' Preserve the path structure of the files Archive1.PreservePath = True ' Include any subdirectories Archive1.IncludeSubs = True ' Specify compression level Archive1.CompressionLevel = CompressionLevel.Medium ' Use the Deflate compression method Archive1.DefaultCompressionMethod = CompressionMethod.Deflate ' Exclude any text files Archive1.ExcludePattern = "*.txt" ' Set to use encryption Archive1.DefaultEncryption = Encryption.Standard ' Specify the password Archive1.Password = "testme" ' Perform the compression operation - this is the only required method for the operation Archive1.QuickZip("c:\\Test\\*.*", "c:\\test.zip")
// Be sure to import the namespace by putting "using Dart.PowerTCP.Zip;" // at the top of your class. // Preserve the path structure of the files archive1.PreservePath = true; // Include any subdirectories archive1.IncludeSubs = true; // Specify compression level archive1.CompressionLevel = CompressionLevel.Medium; // Use the Deflate compression method archive1.DefaultCompressionMethod = CompressionMethod.Deflate; // Exclude any text files archive1.ExcludePattern = "*.txt"; // Set to use encryption archive1.DefaultEncryption = Encryption.Standard; // Specify the password archive1.Password = "testme"; // Perform the compression operation - this is the only required method for the operation archive1.QuickZip("c:\\Test\\*.*", "c:\\test.zip");