我已经这样做了一个备份我的数据库 其做工精细....如何使用离子库
private void backupDatabase()
{
txtbackup.AppendText("Starting Backup...");
Process sd = null;
const string backupcmd = @"C:\wamp\www\access\mysqldump.exe";
string filepath = @"C:\folder\Access\";
string dbHost = "local";
string dbuser = "root";
string dbName = "access";
string backupName = "Backup.sql";
ProcessStartInfo r1 = new ProcessStartInfo(backupcmd, string.Format("-h {0} -u {1} {2} -r {3}", dbHost, dbuser, dbName, backupName));
r1.CreateNoWindow = true;
r1.WorkingDirectory = filepath;
r1.UseShellExecute = false;
r1.WindowStyle = ProcessWindowStyle.Minimized;
r1.RedirectStandardInput = false;
sd = Process.Start(r1);
sd.WaitForExit();
if (!sd.HasExited)
{
sd.Close();
}
sd.Dispose();
r1 = null;
sd = null;
txtbackup.Clear();
txtbackup.AppendText("Backup is Finished");
}
其工作正常...但我想存储backup.sql到压缩文件在这条道路
@"C:\folder\Access\";
一个zip文件,我有这个库Ionic.Zip.Reduced,但我不知道如何来压缩文件,并存储在指定的路径....
如何为两个需要单独ZIP的文件执行此操作? – user001