当前位置: 首页>>代码示例>>C#>>正文


C# ExtractExistingFileAction类代码示例

本文整理汇总了C#中ExtractExistingFileAction的典型用法代码示例。如果您正苦于以下问题:C# ExtractExistingFileAction类的具体用法?C# ExtractExistingFileAction怎么用?C# ExtractExistingFileAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ExtractExistingFileAction类属于命名空间,在下文中一共展示了ExtractExistingFileAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UnzipArchiveTask

 public UnzipArchiveTask(string @zipArchiveFilename, string to, DestinationCleanOptions options, Path path, ExtractExistingFileAction? explicitExistingFileAction)
     : base(path)
 {
     _zipArchiveFilename = zipArchiveFilename;
      _to = to;
      _options = options;
      _explicitExistingFileAction = explicitExistingFileAction;
 }
开发者ID:AkosLukacs,项目名称:dropkick,代码行数:8,代码来源:UnzipArchiveTask.cs

示例2: Unpack

 public void Unpack(ExtractExistingFileAction existingFileAction)
 {
     using (ZipFile modZip = ZipFile.Read(this.location))
     {
         foreach (ZipEntry zipEntry in modZip)
         {
             zipEntry.Extract(FileSystemUtils.unPackagedDir, existingFileAction);
         }
     }
 }
开发者ID:Tommsy64,项目名称:Solder-Mod-Packager,代码行数:10,代码来源:ModFile.cs

示例3: Extract

		/// <summary>
		/// 
		/// </summary>
		/// <param name="archiveFile"></param>
		/// <param name="targetDirectory"></param>
		/// <param name="overwrite"></param>
		/// <param name="password"></param>
		public static void Extract(string archiveFile, string targetDirectory, ExtractExistingFileAction overwrite, string password)
		{
			using (var zip = ZipFile.Read(archiveFile))
			{
				foreach (var entry in zip)
				{
					entry.ExtractWithPassword(targetDirectory, (Ionic.Zip.ExtractExistingFileAction)((int)overwrite), password);
				}
			}
		}
开发者ID:jerryshi2007,项目名称:AK47Source,代码行数:17,代码来源:CompressManager.Extract.cs

示例4: ExtractFileFromZip

        /// <summary>ZIPファイルを解凍</summary>
        /// <param name="zipFileName">ZIPファイル名</param>
        /// <param name="directoryToUnZip">解凍先</param>
        /// <param name="selectionDlgt">ファイル選択デリゲード</param>
        /// <param name="selectionCriteriaInfo">ファイル選択基準情報</param>
        /// <param name="extractExistingFile">上書き時の動作</param>
        /// <param name="enc">エンコーディング</param>
        /// <param name="zipPassword">パスワード</param>
        public void ExtractFileFromZip(
            string zipFileName, string directoryToUnZip,
            SelectionDelegate selectionDlgt,
            object selectionCriteriaInfo,
            ExtractExistingFileAction extractExistingFile,
            Encoding enc, string zipPassword)
        {
            #region ファイル選択

            // ファイル選択デリゲード
            if (selectionCriteriaInfo != null)
            {
                // 指定のデリゲード
                this._selectionDlgt = selectionDlgt;
                // ファイル選択基準情報
                this._selectionCriteriaInfo = selectionCriteriaInfo;
            }

            #endregion

            // ZipFileを取得
            ZipFile zip = this.GetZipFile(zipFileName, enc, zipPassword);

            using (zip) // 使い終ったら「zip.Dispose」する。
            {
                //// ● フォルダのアーカイブ
                //zip.ExtractAll(directoryToUnZip, extractExistingFile);

                // ● ファイルを個別に追加する(UOCにて実装)。
                foreach (ZipEntry ze in zip.Entries)
                {
                    // 圧縮対象ファイルを選択(ファイル選択デリゲードを使用)
                    if (this.SelectionDlgt(ze.FileName, selectionCriteriaInfo))
                    {
                        // デフォルトでは、zipファイルの位置に解凍される。
                        ze.Extract(directoryToUnZip, extractExistingFile);
                    }
                }
            }
        }
开发者ID:krt,项目名称:OpenTouryo,代码行数:48,代码来源:UnZipper.cs

示例5: ExistingFilesAction

 public UnzipOptions ExistingFilesAction(ExtractExistingFileAction action)
 {
     _explicitExistingFileAction = action;
      return this;
 }
开发者ID:AkosLukacs,项目名称:dropkick,代码行数:5,代码来源:ProtoUnzipArchiveTask.cs

示例6: ExtractWithPassword

 /// <summary>
 /// Extract the entry to the filesystem, starting at the specified base directory, and
 /// using the specified behavior when extraction would overwrite an existing file.
 /// </summary>
 ///
 /// <remarks>
 /// See the remarks on the <see cref="LastModified"/> property, for some details
 /// about how the last modified time of the created file is set.
 /// </remarks>
 ///
 /// <param name="baseDirectory">the pathname of the base directory</param>
 ///
 /// <param name="extractExistingFile">The action to take if extraction would
 /// overwrite an existing file.</param>
 ///
 /// <param name="password">The Password to use for decrypting the entry.</param>
 public void ExtractWithPassword(string baseDirectory, ExtractExistingFileAction extractExistingFile, string password)
 {
     ExtractExistingFile = extractExistingFile;
     InternalExtract(baseDirectory, null, password);
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:21,代码来源:ZipEntry.Extract.cs

示例7: Extract

 /// <summary>
 /// Extract the entry to a file in the filesystem, using the specified behavior
 /// when extraction would overwrite an existing file.
 /// </summary>
 /// <remarks>
 /// <para>
 /// See the remarks on the <see cref="LastModified"/> property, for some details
 /// about how the last modified time of the file is set after extraction.
 /// </para>
 /// </remarks>
 /// <param name="extractExistingFile">The action to take if extraction would
 /// overwrite an existing file.</param>
 public void Extract(ExtractExistingFileAction extractExistingFile)
 {
     ExtractExistingFile = extractExistingFile;
     InternalExtract(".", null, null);
 }
开发者ID:leesanghyun2,项目名称:mp-onlinevideos2,代码行数:17,代码来源:ZipEntry.Extract.cs

示例8: ExtractWithPassword

 /// <summary>
 ///   Extract the entry to the filesystem, starting at the specified base
 ///   directory, and using the specified behavior when extraction would
 ///   overwrite an existing file.
 /// </summary>
 ///
 /// <remarks>
 ///   See the remarks on the <see cref="LastModified"/> property, for some
 ///   details about how the last modified time of the created file is set.
 /// </remarks>
 ///
 /// <param name="baseDirectory">the pathname of the base directory</param>
 ///
 /// <param name="extractExistingFile">The action to take if extraction would
 /// overwrite an existing file.</param>
 ///
 /// <param name="password">The Password to use for decrypting the entry.</param>
 public void ExtractWithPassword(string baseDirectory, ExtractExistingFileAction extractExistingFile, string password)
 {
     ExtractExistingFile = extractExistingFile;
     InternalExtractToBaseDir(baseDirectory, password, _container, _Source, FileName);
 }
开发者ID:jkingben,项目名称:DotNetZip.Semverd,代码行数:22,代码来源:ZipEntry.Extract.cs

示例9: Unzipper

 public Unzipper(string zipFilePath, ExtractExistingFileAction extractionStratedy = ExtractExistingFileAction.OverwriteSilently)
 {
     this.Path = zipFilePath;
     this.ExtractionStrategy = extractionStratedy;
 }
开发者ID:Team-Mercury,项目名称:Databases-2015-Teamwork,代码行数:5,代码来源:Unzipper.cs

示例10: ExtractSelectedEntries

 /// <summary>
 /// Selects and Extracts a set of Entries from the ZipFile.
 /// </summary>
 ///
 /// <remarks>
 /// <para>
 /// The entries are extracted into the current working directory. When extraction would would
 /// overwrite an existing filesystem file, the action taken is as specified in the
 /// <paramref name="extractExistingFile"/> parameter.
 /// </para>
 ///
 /// <para>
 /// For information on the syntax of the string describing the entry selection criteria,
 /// see <see cref="AddSelectedFiles(String)" />.
 /// </para>
 /// </remarks>
 ///
 /// <example>
 /// This example shows how extract all XML files modified after 15 January 2009,
 /// overwriting any existing files.
 /// <code>
 /// using (ZipFile zip = ZipFile.Read(zipArchiveName))
 /// {
 ///   zip.ExtractSelectedEntries("name = *.xml  and  mtime &gt; 2009-01-15",
 ///                              ExtractExistingFileAction.OverwriteSilently);
 /// }
 /// </code>
 /// </example>
 ///
 /// <param name="selectionCriteria">the selection criteria for entries to extract.</param>
 ///
 /// <param name="extractExistingFile">
 /// The action to take if extraction would overwrite an existing file.
 /// </param>
 internal void ExtractSelectedEntries(String selectionCriteria, ExtractExistingFileAction extractExistingFile)
 {
     foreach (ZipEntry e in SelectEntries(selectionCriteria))
     {
         e.Password = _Password; // possibly null
         e.Extract(extractExistingFile);
     }
 }
开发者ID:GitOffice,项目名称:DataPie,代码行数:42,代码来源:ZipFile.Selector.cs

示例11: ExtractAll

 /// <summary>
 /// Extracts all of the items in the zip archive, to the specified path in the
 /// filesystem, using the specified behavior when extraction would overwrite an
 /// existing file.
 /// </summary>
 ///
 /// <remarks>
 ///
 /// <para>
 /// This method will extract all entries in the <c>ZipFile</c> to the specified
 /// path.  For an extraction that would overwrite an existing file, the behavior
 /// is dictated by <paramref name="extractExistingFile"/>, which overrides any
 /// setting you may have made on individual ZipEntry instances.
 /// </para>
 ///
 /// <para>
 /// The action to take when an extract would overwrite an existing file
 /// applies to all entries.  If you want to set this on a per-entry basis,
 /// then you must use <see cref="ZipEntry.Extract(String,
 /// ExtractExistingFileAction)" /> or one of the similar methods.
 /// </para>
 ///
 /// <para>
 /// Calling this method is equivalent to setting the <see
 /// cref="ExtractExistingFile"/> property and then calling <see
 /// cref="ExtractAll(String)"/>.
 /// </para>
 ///
 /// <para>
 /// This method will send verbose output messages to the
 /// <see cref="StatusMessageTextWriter"/>, if it is set on the <c>ZipFile</c> instance.
 /// </para>
 /// </remarks>
 ///
 /// <example>
 /// This example extracts all the entries in a zip archive file, to the
 /// specified target directory.  It does not overwrite any existing files.
 /// <code>
 /// String TargetDirectory= "c:\\unpack";
 /// using(ZipFile zip= ZipFile.Read(ZipFileToExtract))
 /// {
 ///   zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite);
 /// }
 /// </code>
 ///
 /// <code lang="VB">
 /// Dim TargetDirectory As String = "c:\unpack"
 /// Using zip As ZipFile = ZipFile.Read(ZipFileToExtract)
 ///     zip.ExtractAll(TargetDirectory, ExtractExistingFileAction.DontOverwrite)
 /// End Using
 /// </code>
 /// </example>
 ///
 /// <param name="path">
 /// The path to which the contents of the zipfile will be extracted.
 /// The path can be relative or fully-qualified.
 /// </param>
 ///
 /// <param name="extractExistingFile">
 /// The action to take if extraction would overwrite an existing file.
 /// </param>
 /// <seealso cref="ExtractSelectedEntries(String,ExtractExistingFileAction)"/>
 public void ExtractAll(string path, ExtractExistingFileAction extractExistingFile)
 {
     ExtractExistingFile = extractExistingFile;
     _InternalExtractAll(path, true);
 }
开发者ID:Johnnyfly,项目名称:source20131023,代码行数:67,代码来源:ZipFile.Extract.cs

示例12: Extract

 public static void Extract(string zipFile, ExtractExistingFileAction action = ExtractExistingFileAction.OverwriteSilently)
 {
     using (ZipFile zip = ZipFile.Read(zipFile))
     {
         foreach (ZipEntry e in zip)
         {
             zip.ExtractAll(e.FileName, action);
         }
     }
 }
开发者ID:rasadeyan,项目名称:RestlessHoneySeeker,代码行数:10,代码来源:Compression.cs

示例13: ExtractAll

        public static void ExtractAll(ZipFile zip, string destination,
            ExtractExistingFileAction extractExitingFileAction = ExtractExistingFileAction.OverwriteSilently)
        {
            foreach (var entry in zip.Entries) {

                if (string.Equals(entry.FileName, "__MACOSX", StringComparison.OrdinalIgnoreCase) ||
                    string.Equals(entry.FileName, ".DS_Store", StringComparison.OrdinalIgnoreCase))
                    continue;
                entry.Extract (destination, extractExitingFileAction);
            }
        }
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:11,代码来源:Files.cs

示例14: Extract

 /// <summary>
 ///   Extract the entry to a file in the filesystem, using the specified
 ///   behavior when extraction would overwrite an existing file.
 /// </summary>
 ///
 /// <remarks>
 /// <para>
 ///   See the remarks on the <see cref="LastModified"/> property, for some
 ///   details about how the last modified time of the file is set after
 ///   extraction.
 /// </para>
 /// </remarks>
 ///
 /// <param name="extractExistingFile">
 ///   The action to take if extraction would overwrite an existing file.
 /// </param>
 public static void Extract(this ZipEntry zipEntry, ExtractExistingFileAction extractExistingFile)
 {
     zipEntry.ExtractExistingFile = extractExistingFile;
     zipEntry.InternalExtractToBaseDir(".", null);
 }
开发者ID:mattleibow,项目名称:Zip.Portable,代码行数:21,代码来源:Extensions.ZipEntry.Extract.cs

示例15: ExtractWithPassword

 /// <summary>
 ///   Extract the entry to the filesystem, starting at the specified base
 ///   directory, and using the specified behavior when extraction would
 ///   overwrite an existing file.
 /// </summary>
 ///
 /// <remarks>
 ///   See the remarks on the <see cref="LastModified"/> property, for some
 ///   details about how the last modified time of the created file is set.
 /// </remarks>
 ///
 /// <param name="baseDirectory">the pathname of the base directory</param>
 ///
 /// <param name="extractExistingFile">The action to take if extraction would
 /// overwrite an existing file.</param>
 ///
 /// <param name="password">The Password to use for decrypting the entry.</param>
 public static void ExtractWithPassword(this ZipEntry zipEntry, string baseDirectory, ExtractExistingFileAction extractExistingFile, string password)
 {
     zipEntry.ExtractExistingFile = extractExistingFile;
     zipEntry.InternalExtractToBaseDir(baseDirectory, password);
 }
开发者ID:mattleibow,项目名称:Zip.Portable,代码行数:22,代码来源:Extensions.ZipEntry.Extract.cs


注:本文中的ExtractExistingFileAction类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。