Пример #1
0
        /// <summary>
        ///  Performs file compression using selected archiving tool, file(s) will be inserted directly to the archive file.
        /// </summary>
        /// <param name="path">File / directory path to archive</param>
        /// <param name="archivingtool">Archiving tool to use</param>
        /// <returns></returns>
        public static FileInfo CompressInsert(string path, ArchivingToolEnum archivingtool)
        {
            FileInfo _file = null;

            Archiver _archiver = new Archiver(path, archivingtool);

            _archiver.ArchivingMethod = ArchivingMethodEnum.Insert;
            _file = _archiver.Archive(); _archiver.Dispose();

            return(_file);
        }
        private void ArchiverSample01()
        {
            #region "Archiver 01"

            Archiver _archiver = new Archiver(Application.StartupPath + "\\my folder to archive", 
                                 ArchivingToolEnum.SevenZip, ProcessWindowStyle.Hidden);
           
            System.IO.FileInfo _archivefile = _archiver.Archive();

            #endregion
        }
        /// <summary>
        ///  Performs file compression using selected archiving tool, file(s) will be inserted directly to the archive file.
        /// </summary>
        /// <param name="path">File / directory path to archive</param>
        /// <param name="archivingtool">Archiving tool to use</param>
        /// <returns>A System.IO.FileInfo object that contains the archived output file information. Returns nothing if error has been encountered during archive routines.</returns>
        /// <example>
        /// <code source="..\Development.Materia\Examples\Example.cs" region="Archiver 05" language="cs" />
        /// <code source="..\Development.Materia\Development.Materia.VBExamples\Development.Materia.VBExamples\Example.vb" region="Archiver 05" language="vbnet" />
        /// </example> 
        public static FileInfo CompressInsert(string path, ArchivingToolEnum archivingtool)
        {
            FileInfo _file = null;

            Archiver _archiver = new Archiver(path, archivingtool);
            _archiver.ArchivingMethod = ArchivingMethodEnum.Insert;
            _file = _archiver.Archive(); _archiver.Dispose();

            return _file;
        }