Unfortunately, this structure does not have such functionality. There is a way to create ZIP files, but without a password. If you want to create password protected ZIP files in C #, I would recommend SevenZipSharp . This is basically a managed shell for 7-Zip.
SevenZipBase.SetLibraryPath(Path.Combine( Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? Environment.CurrentDirectory, "7za.dll")); SevenZipCompressor compressor = new SevenZipCompressor(); compressor.Compressing += Compressor_Compressing; compressor.FileCompressionStarted += Compressor_FileCompressionStarted; compressor.CompressionFinished += Compressor_CompressionFinished; string password = @"whatever"; string destinationFile = @"C:\Temp\whatever.zip"; string[] sourceFiles = Directory.GetFiles(@"C:\Temp\YourFiles\"); if (String.IsNullOrWhiteSpace(password)) { compressor.CompressFiles(destinationFile, sourceFiles); } else {
source share