

Private void btnDecompress_Click( object sender, EventArgs e) (FileName) ' add to zip fileįurther, you can validate the password while extracting each entry by initializing a UserInputDialog form to validate the password using the if-else statement. ' Add password for each entry that is compressed If FileName.EndsWith( "zip") Then Continue For S = s.Substring(0, s.IndexOf( "\bin")) & "\resources" ' Populate zip file and listįor Each f As String In Directory.GetFiles(s) Private Sub BtnCompress_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)ĭim s As String = Assembly.GetExecutingAssembly().Location ListViewItem lvi = new ListViewItem( new string )ĭim hasEntries As Boolean = ( > 0)

Pct = 1 - ((( double)ze.SizeCompressed) / (( double)ze.SizeUncompressed)) Add password for each entry that is compressed S = s.Substring(0, s.IndexOf( + Populate zip file and listįoreach ( string f in Directory.GetFiles(s)) Private void btnCompress_Click( object sender, EventArgs e) Then, assign a password to each entry to be added in the zip file using the Password property of C1ZipFile class, and add the entry to the zip archive by passing the Add method on the Entries property of C1ZipEntr圜ollection class. In order to extract the entry in the zip file, the user can set the Password property to the same value that was used while adding the entry.įor adding a password to an entry, you have to create a zip file using the Create method of C1ZipFile class. The library also provides the CheckPassword method of C1ZipEntry class. The C1Zip library provides the Password property in C1ZipFile class to add password to each entry in the zip file prior to adding the file to the zip archive.

Protecting your zip file with passwords can keep intruders at bay from the confidential information you share across the wire. While sending your sensitive zip files over the internet, it is essential to secure the data using advanced password protection.
