You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

System.IO.Compression.ZipFile.xml 34 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <doc>
  3. <assembly>
  4. <name>System.IO.Compression.ZipFile</name>
  5. </assembly>
  6. <members>
  7. <member name="T:System.IO.Compression.ZipFile">
  8. <summary>提供创建、解压缩和打开 zip 存档的静态方法。</summary>
  9. </member>
  10. <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String)">
  11. <summary>创建 zip 存档,该存档包含指定目录的文件和目录。</summary>
  12. <param name="sourceDirectoryName">要存档的目录的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  13. <param name="destinationArchiveFileName">要生成的存档路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  14. <exception cref="T:System.ArgumentException">
  15. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
  16. <exception cref="T:System.ArgumentNullException">
  17. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is null.</exception>
  18. <exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  19. <exception cref="T:System.IO.DirectoryNotFoundException">
  20. <paramref name="sourceDirectoryName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  21. <exception cref="T:System.IO.IOException">
  22. <paramref name="destinationArchiveFileName" /> already exists.-or-A file in the specified directory could not be opened.</exception>
  23. <exception cref="T:System.UnauthorizedAccessException">
  24. <paramref name="destinationArchiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the directory specified in <paramref name="sourceDirectoryName" /> or the file specified in <paramref name="destinationArchiveFileName" />.</exception>
  25. <exception cref="T:System.NotSupportedException">
  26. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.-or-The zip archive does not support writing.</exception>
  27. </member>
  28. <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String,System.IO.Compression.CompressionLevel,System.Boolean)">
  29. <summary>创建 zip 存档,该存档包括指定目录的文件和目录,使用指定压缩级别,以及可以选择包含基目录。</summary>
  30. <param name="sourceDirectoryName">要存档的目录的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  31. <param name="destinationArchiveFileName">要生成的存档路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  32. <param name="compressionLevel">指示创建项时是否强调速度或压缩有效性的枚举值之一。</param>
  33. <param name="includeBaseDirectory">包括从在存档的根的 <paramref name="sourceDirectoryName" /> 的目录名称,则为 true;仅包含目录中的内容,则为 false。</param>
  34. <exception cref="T:System.ArgumentException">
  35. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
  36. <exception cref="T:System.ArgumentNullException">
  37. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is null.</exception>
  38. <exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  39. <exception cref="T:System.IO.DirectoryNotFoundException">
  40. <paramref name="sourceDirectoryName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  41. <exception cref="T:System.IO.IOException">
  42. <paramref name="destinationArchiveFileName" /> already exists.-or-A file in the specified directory could not be opened.</exception>
  43. <exception cref="T:System.UnauthorizedAccessException">
  44. <paramref name="destinationArchiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the directory specified in <paramref name="sourceDirectoryName" /> or the file specified in <paramref name="destinationArchiveFileName" />.</exception>
  45. <exception cref="T:System.NotSupportedException">
  46. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.-or-The zip archive does not support writing.</exception>
  47. </member>
  48. <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String,System.IO.Compression.CompressionLevel,System.Boolean,System.Text.Encoding)">
  49. <summary>创建 zip 存档,该存档包括文件和指定目录的目录,使用指定压缩级别和条目名称的字符编码,以及可以选择包含基目录。</summary>
  50. <param name="sourceDirectoryName">要存档的目录的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  51. <param name="destinationArchiveFileName">要生成的存档路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  52. <param name="compressionLevel">指示创建项时是否强调速度或压缩有效性的枚举值之一。</param>
  53. <param name="includeBaseDirectory">包括从在存档的根的 <paramref name="sourceDirectoryName" /> 的目录名称,则为 true;仅包含目录中的内容,则为 false。</param>
  54. <param name="entryNameEncoding">在存档中读取或写入项名时使用的编码。仅当需要针对具有不支持项名的 UTF-8 编码的 zip 归档工具和库的互操作性进行编码时,为此参数指定一个值。</param>
  55. <exception cref="T:System.ArgumentException">
  56. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.-or-<paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
  57. <exception cref="T:System.ArgumentNullException">
  58. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is null.</exception>
  59. <exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  60. <exception cref="T:System.IO.DirectoryNotFoundException">
  61. <paramref name="sourceDirectoryName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  62. <exception cref="T:System.IO.IOException">
  63. <paramref name="destinationArchiveFileName" /> already exists.-or-A file in the specified directory could not be opened.</exception>
  64. <exception cref="T:System.UnauthorizedAccessException">
  65. <paramref name="destinationArchiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the directory specified in <paramref name="sourceDirectoryName" /> or the file specified in <paramref name="destinationArchiveFileName" />.</exception>
  66. <exception cref="T:System.NotSupportedException">
  67. <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.-or-The zip archive does not support writing.</exception>
  68. </member>
  69. <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String)">
  70. <summary>将指定 zip 存档中的所有文件都解压缩到文件系统的一个目录下。</summary>
  71. <param name="sourceArchiveFileName">要解压缩存档的路径。</param>
  72. <param name="destinationDirectoryName">放置解压缩文件的目录的路径,指定为相对或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  73. <exception cref="T:System.ArgumentException">
  74. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
  75. <exception cref="T:System.ArgumentNullException">
  76. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is null.</exception>
  77. <exception cref="T:System.IO.PathTooLongException">The specified path in <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> exceeds the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  78. <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
  79. <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.-or-The name of an entry in the archive is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.-or-Extracting an archive entry would create a file that is outside the directory specified by <paramref name="destinationDirectoryName" />.(For example, this might happen if the entry name contains parent directory accessors.)-or-An archive entry to extract has the same name as an entry that has already been extracted from the same archive.</exception>
  80. <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to access the archive or the destination directory.</exception>
  81. <exception cref="T:System.NotSupportedException">
  82. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> contains an invalid format.</exception>
  83. <exception cref="T:System.IO.FileNotFoundException">
  84. <paramref name="sourceArchiveFileName" /> was not found.</exception>
  85. <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid zip archive.-or-An archive entry was not found or was corrupt.-or-An archive entry was compressed by using a compression method that is not supported.</exception>
  86. </member>
  87. <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String,System.Text.Encoding)">
  88. <summary>将指定 zip 存档中的所有文件解压缩到文件系统的一目录下,并使用项名称的指定字符编码。</summary>
  89. <param name="sourceArchiveFileName">要解压缩存档的路径。</param>
  90. <param name="destinationDirectoryName">放置解压缩文件的目录的路径,指定为相对或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  91. <param name="entryNameEncoding">在存档中读取或写入项名时使用的编码。仅当需要针对具有不支持项名的 UTF-8 编码的 zip 归档工具和库的互操作性进行编码时,为此参数指定一个值。</param>
  92. <exception cref="T:System.ArgumentException">
  93. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.-or-<paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
  94. <exception cref="T:System.ArgumentNullException">
  95. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is null.</exception>
  96. <exception cref="T:System.IO.PathTooLongException">The specified path in <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> exceeds the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  97. <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
  98. <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.-or-The name of an entry in the archive is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.-or-Extracting an archive entry would create a file that is outside the directory specified by <paramref name="destinationDirectoryName" />.(For example, this might happen if the entry name contains parent directory accessors.)-or-An archive entry to extract has the same name as an entry that has already been extracted from the same archive.</exception>
  99. <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to access the archive or the destination directory.</exception>
  100. <exception cref="T:System.NotSupportedException">
  101. <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> contains an invalid format.</exception>
  102. <exception cref="T:System.IO.FileNotFoundException">
  103. <paramref name="sourceArchiveFileName" /> was not found.</exception>
  104. <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid zip archive.-or-An archive entry was not found or was corrupt.-or-An archive entry was compressed by using a compression method that is not supported.</exception>
  105. </member>
  106. <member name="M:System.IO.Compression.ZipFile.Open(System.String,System.IO.Compression.ZipArchiveMode)">
  107. <summary>以指定的模式打开指定路径上的 zip 存档。</summary>
  108. <returns>打开的 zip 存档。</returns>
  109. <param name="archiveFileName">要打开的存档的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  110. <param name="mode">指定允许对打开的存档中的项进行的操作的枚举值之一。</param>
  111. <exception cref="T:System.ArgumentException">
  112. <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
  113. <exception cref="T:System.ArgumentNullException">
  114. <paramref name="archiveFileName" /> is null.</exception>
  115. <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  116. <exception cref="T:System.IO.DirectoryNotFoundException">
  117. <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  118. <exception cref="T:System.IO.IOException">
  119. <paramref name="archiveFileName" /> could not be opened.-or-<paramref name="mode" /> is set to <see cref="F:System.IO.Compression.ZipArchiveMode.Create" />, but the file specified in <paramref name="archiveFileName" /> already exists.</exception>
  120. <exception cref="T:System.UnauthorizedAccessException">
  121. <paramref name="archiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
  122. <exception cref="T:System.ArgumentOutOfRangeException">
  123. <paramref name="mode" /> specifies an invalid value.</exception>
  124. <exception cref="T:System.IO.FileNotFoundException">
  125. <paramref name="mode" /> is set to <see cref="F:System.IO.Compression.ZipArchiveMode.Read" />, but the file specified in <paramref name="archiveFileName" /> is not found.</exception>
  126. <exception cref="T:System.NotSupportedException">
  127. <paramref name="archiveFileName" /> contains an invalid format.</exception>
  128. <exception cref="T:System.IO.InvalidDataException">
  129. <paramref name="archiveFileName" /> could not be interpreted as a zip archive.-or-<paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is missing or corrupt and cannot be read.-or-<paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is too large to fit into memory.</exception>
  130. </member>
  131. <member name="M:System.IO.Compression.ZipFile.Open(System.String,System.IO.Compression.ZipArchiveMode,System.Text.Encoding)">
  132. <summary>在指定模式下,在指定路径中,使用项名称的指定字符编码打开 zip 存档。</summary>
  133. <returns>打开的 zip 存档。</returns>
  134. <param name="archiveFileName">要打开的存档的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  135. <param name="mode">指定允许对打开的存档中的项进行的操作的枚举值之一。</param>
  136. <param name="entryNameEncoding">在存档中读取或写入项名时使用的编码。仅当需要针对具有不支持项名的 UTF-8 编码的 zip 归档工具和库的互操作性进行编码时,为此参数指定一个值。</param>
  137. <exception cref="T:System.ArgumentException">
  138. <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.-or-<paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
  139. <exception cref="T:System.ArgumentNullException">
  140. <paramref name="archiveFileName" /> is null.</exception>
  141. <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  142. <exception cref="T:System.IO.DirectoryNotFoundException">
  143. <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  144. <exception cref="T:System.IO.IOException">
  145. <paramref name="archiveFileName" /> could not be opened.-or-<paramref name="mode" /> is set to <see cref="F:System.IO.Compression.ZipArchiveMode.Create" />, but the file specified in <paramref name="archiveFileName" /> already exists.</exception>
  146. <exception cref="T:System.UnauthorizedAccessException">
  147. <paramref name="archiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
  148. <exception cref="T:System.ArgumentOutOfRangeException">
  149. <paramref name="mode" /> specifies an invalid value.</exception>
  150. <exception cref="T:System.IO.FileNotFoundException">
  151. <paramref name="mode" /> is set to <see cref="F:System.IO.Compression.ZipArchiveMode.Read" />, but the file specified in <paramref name="archiveFileName" /> is not found.</exception>
  152. <exception cref="T:System.NotSupportedException">
  153. <paramref name="archiveFileName" /> contains an invalid format.</exception>
  154. <exception cref="T:System.IO.InvalidDataException">
  155. <paramref name="archiveFileName" /> could not be interpreted as a zip archive.-or-<paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is missing or corrupt and cannot be read.-or-<paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is too large to fit into memory.</exception>
  156. </member>
  157. <member name="M:System.IO.Compression.ZipFile.OpenRead(System.String)">
  158. <summary>打开在指定路径用于读取的 zip 存档。</summary>
  159. <returns>打开的 zip 存档。</returns>
  160. <param name="archiveFileName">要打开的存档的路径,指定为相对路径或绝对路径。相对路径是指相对于当前工作目录的路径。</param>
  161. <exception cref="T:System.ArgumentException">
  162. <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
  163. <exception cref="T:System.ArgumentNullException">
  164. <paramref name="archiveFileName" /> is null.</exception>
  165. <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters.</exception>
  166. <exception cref="T:System.IO.DirectoryNotFoundException">
  167. <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
  168. <exception cref="T:System.IO.IOException">
  169. <paramref name="archiveFileName" /> could not be opened.</exception>
  170. <exception cref="T:System.UnauthorizedAccessException">
  171. <paramref name="archiveFileName" /> specifies a directory.-or-The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
  172. <exception cref="T:System.IO.FileNotFoundException">The file specified in <paramref name="archiveFileName" /> is not found.</exception>
  173. <exception cref="T:System.NotSupportedException">
  174. <paramref name="archiveFileName" /> contains an invalid format.</exception>
  175. <exception cref="T:System.IO.InvalidDataException">
  176. <paramref name="archiveFileName" /> could not be interpreted as a zip archive.</exception>
  177. </member>
  178. <member name="T:System.IO.Compression.ZipFileExtensions">
  179. <summary>为 <see cref="T:System.IO.Compression.ZipArchive" /> 和 <see cref="T:System.IO.Compression.ZipArchiveEntry" /> 类提供扩展方法。</summary>
  180. </member>
  181. <member name="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String)">
  182. <summary>通过压缩并将其添加到邮编存档的存档文件。</summary>
  183. <returns>zip 存档中新项的包装。</returns>
  184. <param name="destination">要添加该文件的 zip 存档。</param>
  185. <param name="sourceFileName">待存档的文件的路径。可以指定相对或绝对路径。相对路径被解释为相对于当前工作目录。</param>
  186. <param name="entryName">要在 zip 存档中生成的输入的名称。</param>
  187. <exception cref="T:System.ArgumentException">
  188. <paramref name="sourceFileName" /> 为 <see cref="F:System.String.Empty" />,仅包含空白,或包含至少一个无效字符。- 或 -<paramref name="entryName" /> 为 <see cref="F:System.String.Empty" />。</exception>
  189. <exception cref="T:System.ArgumentNullException">
  190. <paramref name="sourceFileName" /> 或 <paramref name="entryName" /> 为 null。</exception>
  191. <exception cref="T:System.IO.PathTooLongException">在<paramref name="sourceFileName" />内,指定的路径、文件名或者两者都超出了系统定义的最大长度。例如,在基于 Windows 的平台上,路径不得超过 248 个字符,文件名不得超过 260 个字符。</exception>
  192. <exception cref="T:System.IO.DirectoryNotFoundException">
  193. <paramref name="sourceFileName" /> 无效(例如,在未映射的驱动器上)。</exception>
  194. <exception cref="T:System.IO.IOException">无法打开由 <paramref name="sourceFileName" /> 指定的文件。</exception>
  195. <exception cref="T:System.UnauthorizedAccessException">
  196. <paramref name="sourceFileName" /> 指定目录。- 或 -调用方没有访问 <paramref name="sourceFileName" /> 指定的文件的权限。</exception>
  197. <exception cref="T:System.IO.FileNotFoundException">未找到 <paramref name="sourceFileName" /> 指定的文件。</exception>
  198. <exception cref="T:System.NotSupportedException">
  199. <paramref name="sourceFileName" /> 参数的格式无效。- 或 -zip 归档不支持写入。</exception>
  200. <exception cref="T:System.ObjectDisposedException">zip 存档已释放。</exception>
  201. </member>
  202. <member name="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String,System.IO.Compression.CompressionLevel)">
  203. <summary>通过使用指定压缩级别压缩并将其添加到邮编存档的存档文件。</summary>
  204. <returns>zip 存档中新项的包装。</returns>
  205. <param name="destination">要添加该文件的 zip 存档。</param>
  206. <param name="sourceFileName">待存档的文件的路径。可以指定相对或绝对路径。相对路径被解释为相对于当前工作目录。</param>
  207. <param name="entryName">要在 zip 存档中生成的输入的名称。</param>
  208. <param name="compressionLevel">创建项时,指示是否要强调速度或压缩有效性的枚举值之一。</param>
  209. <exception cref="T:System.ArgumentException">
  210. <paramref name="sourceFileName" /> 为 <see cref="F:System.String.Empty" />,仅包含空白,或包含至少一个无效字符。- 或 -<paramref name="entryName" /> 为 <see cref="F:System.String.Empty" />。</exception>
  211. <exception cref="T:System.ArgumentNullException">
  212. <paramref name="sourceFileName" /> 或 <paramref name="entryName" /> 为 null。</exception>
  213. <exception cref="T:System.IO.DirectoryNotFoundException">
  214. <paramref name="sourceFileName" /> 无效(例如,在未映射的驱动器上)。</exception>
  215. <exception cref="T:System.IO.PathTooLongException">在<paramref name="sourceFileName" />内,指定的路径、文件名或者两者都超出了系统定义的最大长度。例如,在基于 Windows 的平台上,路径不得超过 248 个字符,文件名不得超过 260 个字符。</exception>
  216. <exception cref="T:System.IO.IOException">无法打开由 <paramref name="sourceFileName" /> 指定的文件。</exception>
  217. <exception cref="T:System.UnauthorizedAccessException">
  218. <paramref name="sourceFileName" /> 指定目录。- 或 -调用方没有访问 <paramref name="sourceFileName" /> 指定的文件的权限。</exception>
  219. <exception cref="T:System.IO.FileNotFoundException">未找到 <paramref name="sourceFileName" /> 指定的文件。</exception>
  220. <exception cref="T:System.NotSupportedException">
  221. <paramref name="sourceFileName" /> 参数的格式无效。- 或 -zip 归档不支持写入。</exception>
  222. <exception cref="T:System.ObjectDisposedException">zip 存档已释放。</exception>
  223. </member>
  224. <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive,System.String)">
  225. <summary>将 zip 存档中的所有文件都解压到文件系统的一目录下。</summary>
  226. <param name="source">从 zip 归档解压文件。</param>
  227. <param name="destinationDirectoryName">到放置解压缩文件的目录的路径。可以指定相对或绝对路径。相对路径被解释为相对于当前工作目录。</param>
  228. <exception cref="T:System.ArgumentException">
  229. <paramref name="destinationDirectoryName" /> 为 <see cref="F:System.String.Empty" />,仅包含空白,或包含至少一个无效字符。</exception>
  230. <exception cref="T:System.ArgumentNullException">
  231. <paramref name="destinationDirectoryName" /> 为 null。</exception>
  232. <exception cref="T:System.IO.PathTooLongException">指定路径超过了系统定义的最大长度。例如,在基于 Windows 的平台上,路径不得超过 248 个字符,文件名不得超过 260 个字符。</exception>
  233. <exception cref="T:System.IO.DirectoryNotFoundException">指定的路径无效(例如,它位于未映射的驱动器上)。</exception>
  234. <exception cref="T:System.IO.IOException">
  235. <paramref name="destinationDirectoryName" /> 指定的目录已存在。- 或 -一个在存档中的输入名称是 <see cref="F:System.String.Empty" />,仅包含空白或包含至少一个无效字符。- 或 -从存档中提取条目将生成在 <paramref name="destinationDirectoryName" /> 指定的目录之外的一个文件。(例如,如果该输入名称包括父目录访问器,则这可能发生。)- 或 -存档中具有相同名称的两个或多个项。</exception>
  236. <exception cref="T:System.UnauthorizedAccessException">调用方不具有所需权限以便写入到目标目录。</exception>
  237. <exception cref="T:System.NotSupportedException">
  238. <paramref name="destinationDirectoryName" /> 包含无效格式。</exception>
  239. <exception cref="T:System.IO.InvalidDataException">未能找到归档项或已损坏。- 或 -通过一种不支持的压缩方法,对一个存档条目进行压缩。</exception>
  240. </member>
  241. <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String)">
  242. <summary>将 zip 存档中的条目解压到文件下。</summary>
  243. <param name="source">从 zip 归档项解压文件。</param>
  244. <param name="destinationFileName">从输入的内容生成的文件的路径。可以指定相对或绝对路径。相对路径被解释为相对于当前工作目录。</param>
  245. <exception cref="T:System.ArgumentException">
  246. <paramref name="destinationFileName" /> 是一个零长度字符串,仅包含空白或者包含一个或多个由 <see cref="F:System.IO.Path.InvalidPathChars" /> 定义的无效字符。- 或 -<paramref name="destinationFileName" /> 指定目录。</exception>
  247. <exception cref="T:System.ArgumentNullException">
  248. <paramref name="destinationFileName" /> 为 null。</exception>
  249. <exception cref="T:System.IO.PathTooLongException">指定的路径、文件名或者两者都超出了系统定义的最大长度。例如,在基于 Windows 的平台上,路径不得超过 248 个字符,文件名不得超过 260 个字符。</exception>
  250. <exception cref="T:System.IO.DirectoryNotFoundException">指定的路径无效(例如,它位于未映射的驱动器上)。</exception>
  251. <exception cref="T:System.IO.IOException">
  252. <paramref name="destinationFileName" /> 已存在。- 或 -发生了 I/O 错误。- 或 -该项当前为编写开放。- 或 -已从存档中删除的项。</exception>
  253. <exception cref="T:System.UnauthorizedAccessException">调用方没有创建新文件所需的权限。</exception>
  254. <exception cref="T:System.IO.InvalidDataException">该输入从存档中缺失,或损坏且无法读取。- 或 -该输入已经通过使用一种不被支持的压缩方法压缩。</exception>
  255. <exception cref="T:System.ObjectDisposedException">已释放属于 zip 归档项。</exception>
  256. <exception cref="T:System.NotSupportedException">
  257. <paramref name="destinationFileName" /> 的格式无效。- 或 -该 zip 归档项在 <see cref="F:System.IO.Compression.ZipArchiveMode.Create" /> 模式中打开的,不允许项检索。</exception>
  258. </member>
  259. <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String,System.Boolean)">
  260. <summary>将 zip 存档中的条目解压到文件下,并可选择覆盖具有相同名称的现存文件。</summary>
  261. <param name="source">从 zip 归档项解压文件。</param>
  262. <param name="destinationFileName">从输入的内容生成的文件的路径。可以指定相对或绝对路径。相对路径被解释为相对于当前工作目录。</param>
  263. <param name="overwrite">如果覆盖带与目标文件同名的名称的现有文件,则为 true;否则为 false。</param>
  264. <exception cref="T:System.ArgumentException">
  265. <paramref name="destinationFileName" /> 是一个零长度字符串,仅包含空白或者包含一个或多个由 <see cref="F:System.IO.Path.InvalidPathChars" /> 定义的无效字符。- 或 -<paramref name="destinationFileName" /> 指定目录。</exception>
  266. <exception cref="T:System.ArgumentNullException">
  267. <paramref name="destinationFileName" /> 为 null。</exception>
  268. <exception cref="T:System.IO.PathTooLongException">指定的路径、文件名或者两者都超出了系统定义的最大长度。例如,在基于 Windows 的平台上,路径不得超过 248 个字符,文件名不得超过 260 个字符。</exception>
  269. <exception cref="T:System.IO.DirectoryNotFoundException">指定的路径无效(例如,它位于未映射的驱动器上)。</exception>
  270. <exception cref="T:System.IO.IOException">
  271. <paramref name="destinationFileName" /> 已存在,且 <paramref name="overwrite" /> 是 false。- 或 -发生了 I/O 错误。- 或 -该项当前为编写开放。- 或 -已从存档中删除的项。</exception>
  272. <exception cref="T:System.UnauthorizedAccessException">调用方没有创建新文件所需的权限。</exception>
  273. <exception cref="T:System.IO.InvalidDataException">该输入从存档中缺失或损坏且无法读取。- 或 -该输入已经通过使用一种不被支持的压缩方法压缩。</exception>
  274. <exception cref="T:System.ObjectDisposedException">已释放属于 zip 归档项。</exception>
  275. <exception cref="T:System.NotSupportedException">
  276. <paramref name="destinationFileName" /> 的格式无效。- 或 -该 zip 归档项在 <see cref="F:System.IO.Compression.ZipArchiveMode.Create" /> 模式中打开的,不允许项检索。</exception>
  277. </member>
  278. </members>
  279. </doc>