Example #1
0
        /// <summary>
        /// Zips up the files in the export directory to a backup zip file.
        /// </summary>
        /// <returns>The full path to the zip file.</returns>
        private string ZipFiles()
        {
            string zipFileName = @"Backup--" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "--" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + "--(" + Guid.NewGuid().ToString().Substring(0, Guid.NewGuid().ToString().IndexOf('-')) + ").zip";

            string zipFilePath = BackupDirectoryPath + Path.DirectorySeparatorChar +
                                 zipFileName;

            DirectoryZipper zipper = new DirectoryZipper(ExportDirectoryPath);

            TotalFilesZipped = zipper.ZipToFile(zipFilePath);


            return(zipFilePath);
        }
        /// <summary>
        /// Zips up the files in the export directory to a backup zip file.
        /// </summary>
        /// <returns>The full path to the zip file.</returns>
        private string ZipFiles()
        {
            string zipFileName = @"Backup--" + DateTime.Now.Year + "-" + DateTime.Now.Month + "-" + DateTime.Now.Day + "--" + DateTime.Now.Hour + "-" + DateTime.Now.Minute + "-" + DateTime.Now.Second + "--(" + Guid.NewGuid().ToString().Substring(0, Guid.NewGuid().ToString().IndexOf('-')) + ").zip";

            string zipFilePath = BackupDirectoryPath + Path.DirectorySeparatorChar +
                zipFileName;

            DirectoryZipper zipper = new DirectoryZipper(ExportDirectoryPath);

            TotalFilesZipped = zipper.ZipToFile(zipFilePath);

            return zipFilePath;
        }