String BackupFileName = " " + FileName + ". String FileName = " '"+txtLocation.Text + " Backup" MessageBox.Show( " Please select Backup File Location", " Error", MessageBoxButtons.OK, MessageBoxIcon.Error) If it is not possible for some reason, then do not forget to call the Dispose() method when you complete all operations.Private void btnSave_Click( object sender, EventArgs e) Telerik Support recommends that you declare and instantiate the ZIP archive object in a using statement. You must always dispose of the ZIP archive object when all operations that use it are competed. Using (Stream stream = File.Open("test.zip", FileMode.Create)) Using stream As Stream = File.Open("test.zip", FileMode.Open) Dim encryptionSettings As New DefaultEncryptionSettings() encryptionSettings.Password = "password" Using archive As New ZipArchive(stream, ZipArchiveMode.Read, False, Nothing, Nothing, encryptionSettings) ' Display the list of the files in the selected zip file using the ZipArchive.Entries property. In order to create a password-protected ZIP archive, you need to pass a DefaultEncryptionSettings object to the ZipArchive's constructor along with the ZipArchiveMode.Create parameter.ĭefaultEncryptionSettings has a Password property of type string, which represents the used password.Įxample 1: Create a password-protected ZIP archive The settings for this encryption type are represented by the DefaultEncryptionSettings class. RadZipLibrary supports traditional PKWARE encryption only. To protect a ZIP archive and all ZipArchiveEntry items in it, you should specify encryption settings when creating the ZipArchive object. This help article will teach you to use RadZipLibrary to password protect files and how to open files that are protected with a password. RadZipLibrary lets you protect a ZIP archive with a password. Download free 30-day trial Protect ZipArchive
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |