• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ExtractExistingFileAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: ExtractWithPassword

 /// <summary>
 ///   Extract the entry to a file in the filesystem, relative to the
 ///   current directory, 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 created file is set.
 /// </para>
 /// </remarks>
 ///
 /// <param name="password">The Password to use for decrypting the entry.</param>
 ///
 /// <param name="extractExistingFile">
 /// The action to take if extraction would overwrite an existing file.
 /// </param>
 public void ExtractWithPassword(ExtractExistingFileAction extractExistingFile, UInt32 key1, UInt32 key2, UInt32 key3)
 {
     ExtractExistingFile = extractExistingFile;
     InternalExtract(".", null, key1, key2, key3);
 }
开发者ID:Nielk1,项目名称:DotNetZip.ZipReducedKeyDecrypt,代码行数:23,代码来源:ZipEntry.Extract.cs


示例17: 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>
 public void ExtractSelectedEntries(String selectionCriteria, ExtractExistingFileAction extractExistingFile)
 {
     foreach (ZipEntry e in SelectEntries(selectionCriteria))
     {
         e.Extract(extractExistingFile);
     }
 }
开发者ID:Nielk1,项目名称:DotNetZip.ZipReducedKeyDecrypt,代码行数:41,代码来源:ZipFile.Selector.cs


示例18: UnpackZip

 private void UnpackZip(string packagePath, string unpackPath, ExtractExistingFileAction existingFileAction)
 {
     using (var file = new ZipFile(packagePath) { UseUnicodeAsNecessary = true }) {
         foreach (var zipEntry in file)
             zipEntry.Extract(unpackPath, existingFileAction);
     }
 }
开发者ID:wurdum,项目名称:deployer,代码行数:7,代码来源:PackageManager.cs


示例19: Extract

 /// <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>
 /// <para>
 ///   See the remarks on the <see cref="LastModified"/> property, for some
 ///   details about how the last modified time of the created file is set.
 /// </para>
 /// </remarks>
 ///
 /// <example>
 /// <code lang="C#">
 /// String sZipPath = "Airborne.zip";
 /// String sFilePath = "Readme.txt";
 /// String sRootFolder = "Digado";
 /// using (ZipFile zip = ZipFile.Read(sZipPath))
 /// {
 ///   if (zip.EntryFileNames.Contains(sFilePath))
 ///   {
 ///     // use the string indexer on the zip file
 ///     zip[sFileName].Extract(sRootFolder,
 ///                            ExtractExistingFileAction.OverwriteSilently);
 ///   }
 /// }
 /// </code>
 ///
 /// <code lang="VB">
 /// Dim sZipPath as String = "Airborne.zip"
 /// Dim sFilePath As String = "Readme.txt"
 /// Dim sRootFolder As String = "Digado"
 /// Using zip As ZipFile = ZipFile.Read(sZipPath)
 ///   If zip.EntryFileNames.Contains(sFilePath)
 ///     ' use the string indexer on the zip file
 ///     zip(sFilePath).Extract(sRootFolder, _
 ///                            ExtractExistingFileAction.OverwriteSilently)
 ///   End If
 /// End Using
 /// </code>
 /// </example>
 ///
 /// <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>
 public void Extract(string baseDirectory, ExtractExistingFileAction extractExistingFile)
 {
     ExtractExistingFile = extractExistingFile;
     InternalExtractToBaseDir(baseDirectory, null, _container, _Source, FileName);
 }
开发者ID:jkingben,项目名称:DotNetZip.Semverd,代码行数:52,代码来源:ZipEntry.Extract.cs


示例20: 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 static void ExtractAll(this ZipFile zipFile, string path, ExtractExistingFileAction extractExistingFile)
 {
     zipFile.ExtractExistingFile = extractExistingFile;
     zipFile._InternalExtractAll(path, true);
 }
开发者ID:mattleibow,项目名称:Zip.Portable,代码行数:67,代码来源:Extensions.ZipFile.Extract.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ExtractValue类代码示例发布时间:2022-05-24
下一篇:
C# ExternalLoginConfirmationViewModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap