ARCed.Helpers.Compressor.CompressDirectory C# (CSharp) 메소드

CompressDirectory() 공개 정적인 메소드

Compresses a directory into a single archive
public static CompressDirectory ( string inDir, string outFile, bool notify = false ) : void
inDir string The path to the directory to compress
outFile string The archive name to create
notify bool Flag to notify user when finished
리턴 void
        public static void CompressDirectory(string inDir, string outFile, bool notify = false)
        {
            SevenZipBase.SetLibraryPath(PathHelper.SevenZipLibrary);
            if (_compressor == null)
            {
                _compressor = new SevenZipCompressor
                {
                    ArchiveFormat = OutArchiveFormat.SevenZip,
                    CompressionLevel = CompressionLevel.Ultra,
                    CompressionMode = CompressionMode.Create
                };
            }
            _notify = notify;
            _compressor.TempFolderPath = Path.GetTempPath();
            _compressor.CompressDirectory(inDir, outFile);
            File.SetCreationTime(outFile, DateTime.Now);
        }