Hi I'm a newbie on C# and trying to Implement backup whole C and D as follow.
I have 2 questions
I would like to add "excluded" folder statement into my code I would like to exclude folders "$Recycle.Bin" "windows" and file name "bootmgr" at the same time, how can I exclude these folders and a file into my code
Although Ionic.zip has 256 AES encryption and password protection, It doesn't encrypt file names and file structure in zip file similar to winrar "Encrypt File Names" option. Is there any external exe file where I can call within c# code of each zip file and encrypt. How you do that to not show file structure ? do you use another zip tools or is there any paid or not library I can import C# to use.
Appreciate your answers
using Ionic.Zip;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace compresszippasswordsplit
{
class Program
{
static void Main(string[] args)
{
using (var zipC = new ZipFile())
{
// Zip C
int SizeBackupMB = 10000;
string Password = "MysecurePassword";
string ZipLocation = @"E:\Allbackups\C-backup" + DateTime.Now.ToString("-dd-MM-yyyy") + ".zip";
string ZipDirectory = @"C:\";
zipC.Password = Password;
zipC.Encryption = EncryptionAlgorithm.WinZipAes256;
zipC.AddDirectory(ZipDirectory);
zipC.MaxOutputSegmentSize = 1024 * 1024 * SizeBackupMB;
zipC.Save(ZipLocation);
}
using (var zipD = new ZipFile())
{
// Zip D
int SizeBackupMB = 10000;
string Password = "MysecurePassword";
string ZipLocation = @"E:\Allbackups\D-backup" + DateTime.Now.ToString("-dd-MM-yyyy") + ".zip";
string ZipDirectory = @"D:\";
zipD.Password = Password;
zipD.Encryption = EncryptionAlgorithm.WinZipAes256;
zipD.AddDirectory(ZipDirectory);
zipD.MaxOutputSegmentSize = 1024 * 1024 * SizeBackupMB;
zipD.Save(ZipLocation);
}
}
}
}