Esempio n. 1
0
        public void StartRestoring(string fileStorageDirectoryFullPath, string databaseFileFullName, string archive)
        {
            ZipOptions options = new ZipOptions()
            {
                Archive = archive,
                Files = fileStorageDirectoryFullPath,
                Database = databaseFileFullName,
            };

            requireCancellation = false;

            worker = new Thread(StartRestoringThread) { Name = "Restoring_Thread" };
            worker.Start(options);
        }
Esempio n. 2
0
        private void CreateArchiveFile(ZipOptions options)
        {
            ZipFile zip = null;
            try
            {
                zip = new ZipFile(Encoding.GetEncoding(866)) // кодировку НЕ МЕНЯТЬ !!!
                {
                    CompressionLevel = options.CompressionLevel,
                    UseZip64WhenSaving = options.Zip64,
                };

                zip.AddDirectory(options.Files, Consts.FileData);
                zip.AddFile(options.Database, "");

                zip.SaveProgress += this.SaveProgress;

                zip.Save(options.Archive);
            }
            finally
            {
                if (zip != null)
                    zip.Dispose();
            }
        }
Esempio n. 3
0
        public void StartArchiving(string storage, string database, string archive)
        {
            requireCancellation = false;

            ZipOptions options = new ZipOptions
            {
                Archive = archive,
                Files = storage,
                Database = database,
                CompressionLevel = CompressionLevel.Default,
                Zip64 = Zip64Option.AsNecessary, //поддержка архивов >4ГБ
            };

            worker = new Thread(StartArchivingThread) { Name = "Archiving_Thread" };

            worker.Start(options);
        }