1 <?xml version="1.0" encoding="utf-8"?>
4 <name>System.IO.Compression.ZipFile</name>
7 <member name="T:System.IO.Compression.ZipFile">
8 <summary>Provides static methods for creating, extracting, and opening zip archives.</summary>
10 <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String)">
11 <summary>Creates a zip archive that contains the files and directories from the specified directory.</summary>
12 <param name="sourceDirectoryName">The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
13 <param name="destinationArchiveFileName">The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</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 <see langword="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.</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.
24 A file in the specified directory could not be opened.</exception>
25 <exception cref="T:System.UnauthorizedAccessException">
26 <paramref name="destinationArchiveFileName" /> specifies a directory.
28 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>
29 <exception cref="T:System.NotSupportedException">
30 <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.
32 The zip archive does not support writing.</exception>
34 <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String,System.IO.Compression.CompressionLevel,System.Boolean)">
35 <summary>Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level, and optionally includes the base directory.</summary>
36 <param name="sourceDirectoryName">The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
37 <param name="destinationArchiveFileName">The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
38 <param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry.</param>
39 <param name="includeBaseDirectory">
40 <see langword="true" /> to include the directory name from <paramref name="sourceDirectoryName" /> at the root of the archive; <see langword="false" /> to include only the contents of the directory.</param>
41 <exception cref="T:System.ArgumentException">
42 <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>
43 <exception cref="T:System.ArgumentNullException">
44 <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is <see langword="null" />.</exception>
45 <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.</exception>
46 <exception cref="T:System.IO.DirectoryNotFoundException">
47 <paramref name="sourceDirectoryName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
48 <exception cref="T:System.IO.IOException">
49 <paramref name="destinationArchiveFileName" /> already exists.
51 A file in the specified directory could not be opened.</exception>
52 <exception cref="T:System.UnauthorizedAccessException">
53 <paramref name="destinationArchiveFileName" /> specifies a directory.
55 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>
56 <exception cref="T:System.NotSupportedException">
57 <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.
59 The zip archive does not support writing.</exception>
61 <member name="M:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String,System.IO.Compression.CompressionLevel,System.Boolean,System.Text.Encoding)">
62 <summary>Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level and character encoding for entry names, and optionally includes the base directory.</summary>
63 <param name="sourceDirectoryName">The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
64 <param name="destinationArchiveFileName">The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
65 <param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry.</param>
66 <param name="includeBaseDirectory">
67 <see langword="true" /> to include the directory name from <paramref name="sourceDirectoryName" /> at the root of the archive; <see langword="false" /> to include only the contents of the directory.</param>
68 <param name="entryNameEncoding">The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.</param>
69 <exception cref="T:System.ArgumentException">
70 <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.
72 <paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
73 <exception cref="T:System.ArgumentNullException">
74 <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> is <see langword="null" />.</exception>
75 <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.</exception>
76 <exception cref="T:System.IO.DirectoryNotFoundException">
77 <paramref name="sourceDirectoryName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
78 <exception cref="T:System.IO.IOException">
79 <paramref name="destinationArchiveFileName" /> already exists.
81 A file in the specified directory could not be opened.</exception>
82 <exception cref="T:System.UnauthorizedAccessException">
83 <paramref name="destinationArchiveFileName" /> specifies a directory.
85 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>
86 <exception cref="T:System.NotSupportedException">
87 <paramref name="sourceDirectoryName" /> or <paramref name="destinationArchiveFileName" /> contains an invalid format.
89 The zip archive does not support writing.</exception>
91 <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String)">
92 <summary>Extracts all the files in the specified zip archive to a directory on the file system.</summary>
93 <param name="sourceArchiveFileName">The path to the archive that is to be extracted.</param>
94 <param name="destinationDirectoryName">The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
95 <exception cref="T:System.ArgumentException">
96 <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>
97 <exception cref="T:System.ArgumentNullException">
98 <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is <see langword="null" />.</exception>
99 <exception cref="T:System.IO.PathTooLongException">The specified path in <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> exceeds the system-defined maximum length.</exception>
100 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
101 <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.
103 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.
105 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.)
107 An archive entry to extract has the same name as an entry that has already been extracted from the same archive.</exception>
108 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to access the archive or the destination directory.</exception>
109 <exception cref="T:System.NotSupportedException">
110 <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> contains an invalid format.</exception>
111 <exception cref="T:System.IO.FileNotFoundException">
112 <paramref name="sourceArchiveFileName" /> was not found.</exception>
113 <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid zip archive.
115 An archive entry was not found or was corrupt.
117 An archive entry was compressed by using a compression method that is not supported.</exception>
119 <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String,System.Boolean)">
120 <summary>Extracts all of the files in the specified archive to a directory on the file system.</summary>
121 <param name="sourceArchiveFileName">The path on the file system to the archive that is to be extracted.</param>
122 <param name="destinationDirectoryName">The path to the destination directory on the file system. The directory specified must not exist, but the directory that it is contained in must exist.</param>
123 <param name="overwriteFiles">
124 <see langword="true" /> to overwrite files; <see langword="false" /> otherwise.</param>
125 <exception cref="T:System.ArgumentException">
126 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.</exception>
127 <exception cref="T:System.ArgumentNullException">
128 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
129 <exception cref="T:System.IO.PathTooLongException">
130 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> specifies a path, a file name, or both that exceed the system-defined maximum length.</exception>
131 <exception cref="T:System.IO.DirectoryNotFoundException">The path specified by <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is invalid (for example, it is on an unmapped drive).</exception>
132 <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.
134 An I/O error has occurred.
136 The name of a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> is zero-length, contains only whitespace, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
138 Extracting a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> would result in a file destination that is outside the destination directory (for example, because of parent directory accessors).
140 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has the same name as an already extracted entry from the same archive.</exception>
141 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
142 <exception cref="T:System.NotSupportedException">
143 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is in an invalid format.</exception>
144 <exception cref="T:System.IO.FileNotFoundException">
145 <paramref name="sourceArchiveFileName" /> was not found.</exception>
146 <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid <see cref="T:System.IO.Compression.ZipArchive" />.
148 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> was not found or was corrupt.
150 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed using a compression method that is not supported.</exception>
152 <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String,System.Text.Encoding)">
153 <summary>Extracts all the files in the specified zip archive to a directory on the file system and uses the specified character encoding for entry names.</summary>
154 <param name="sourceArchiveFileName">The path to the archive that is to be extracted.</param>
155 <param name="destinationDirectoryName">The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
156 <param name="entryNameEncoding">The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.</param>
157 <exception cref="T:System.ArgumentException">
158 <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.
160 <paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
161 <exception cref="T:System.ArgumentNullException">
162 <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> is <see langword="null" />.</exception>
163 <exception cref="T:System.IO.PathTooLongException">The specified path in <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> exceeds the system-defined maximum length.</exception>
164 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
165 <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.
167 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.
169 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.)
171 An archive entry to extract has the same name as an entry that has already been extracted from the same archive.</exception>
172 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to access the archive or the destination directory.</exception>
173 <exception cref="T:System.NotSupportedException">
174 <paramref name="destinationDirectoryName" /> or <paramref name="sourceArchiveFileName" /> contains an invalid format.</exception>
175 <exception cref="T:System.IO.FileNotFoundException">
176 <paramref name="sourceArchiveFileName" /> was not found.</exception>
177 <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid zip archive.
179 An archive entry was not found or was corrupt.
181 An archive entry was compressed by using a compression method that is not supported.</exception>
183 <member name="M:System.IO.Compression.ZipFile.ExtractToDirectory(System.String,System.String,System.Text.Encoding,System.Boolean)">
184 <summary>Extracts all of the files in the specified archive to a directory on the file system.</summary>
185 <param name="sourceArchiveFileName">The path on the file system to the archive that is to be extracted.</param>
186 <param name="destinationDirectoryName">The path to the destination directory on the file system. The directory specified must not exist, but the directory that it is contained in must exist.</param>
187 <param name="entryNameEncoding">The encoding to use when reading entry names in this <see cref="T:System.IO.Compression.ZipArchive" />.</param>
188 <param name="overwriteFiles">
189 <see langword="true" /> to overwrite files; <see langword="false" /> otherwise.</param>
190 <exception cref="T:System.ArgumentException">
191 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
193 <paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
194 <exception cref="T:System.ArgumentNullException">
195 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
196 <exception cref="T:System.IO.PathTooLongException">
197 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> specifies a path, a file name, or both that exceed the system-defined maximum length.</exception>
198 <exception cref="T:System.IO.DirectoryNotFoundException">The path specified by <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is invalid (for example, it is on an unmapped drive).</exception>
199 <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.
201 An I/O error has occurred.
203 The name of a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> is zero-length, contains only whitespace, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
205 Extracting a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> would result in a file destination that is outside the destination directory (for example, because of parent directory accessors).
207 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has the same name as an already extracted entry from the same archive.</exception>
208 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
209 <exception cref="T:System.NotSupportedException">
210 <paramref name="sourceArchiveFileName" /> or <paramref name="destinationDirectoryName" /> is in an invalid format.</exception>
211 <exception cref="T:System.IO.FileNotFoundException">
212 <paramref name="sourceArchiveFileName" /> was not found.</exception>
213 <exception cref="T:System.IO.InvalidDataException">The archive specified by <paramref name="sourceArchiveFileName" /> is not a valid <see cref="T:System.IO.Compression.ZipArchive" />.
215 An archive entry was not found or was corrupt.
217 An archive entry has been compressed using a compression method that is not supported.</exception>
219 <member name="M:System.IO.Compression.ZipFile.Open(System.String,System.IO.Compression.ZipArchiveMode)">
220 <summary>Opens a zip archive at the specified path and in the specified mode.</summary>
221 <param name="archiveFileName">The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
222 <param name="mode">One of the enumeration values that specifies the actions which are allowed on the entries in the opened archive.</param>
223 <returns>The opened zip archive.</returns>
224 <exception cref="T:System.ArgumentException">
225 <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
226 <exception cref="T:System.ArgumentNullException">
227 <paramref name="archiveFileName" /> is <see langword="null" />.</exception>
228 <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.</exception>
229 <exception cref="T:System.IO.DirectoryNotFoundException">
230 <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
231 <exception cref="T:System.IO.IOException">
232 <paramref name="archiveFileName" /> could not be opened.
234 <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>
235 <exception cref="T:System.UnauthorizedAccessException">
236 <paramref name="archiveFileName" /> specifies a directory.
238 The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
239 <exception cref="T:System.ArgumentOutOfRangeException">
240 <paramref name="mode" /> specifies an invalid value.</exception>
241 <exception cref="T:System.IO.FileNotFoundException">
242 <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>
243 <exception cref="T:System.NotSupportedException">
244 <paramref name="archiveFileName" /> contains an invalid format.</exception>
245 <exception cref="T:System.IO.InvalidDataException">
246 <paramref name="archiveFileName" /> could not be interpreted as a zip archive.
248 <paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is missing or corrupt and cannot be read.
250 <paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is too large to fit into memory.</exception>
252 <member name="M:System.IO.Compression.ZipFile.Open(System.String,System.IO.Compression.ZipArchiveMode,System.Text.Encoding)">
253 <summary>Opens a zip archive at the specified path, in the specified mode, and by using the specified character encoding for entry names.</summary>
254 <param name="archiveFileName">The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
255 <param name="mode">One of the enumeration values that specifies the actions that are allowed on the entries in the opened archive.</param>
256 <param name="entryNameEncoding">The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names.</param>
257 <returns>The opened zip archive.</returns>
258 <exception cref="T:System.ArgumentException">
259 <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
261 <paramref name="entryNameEncoding" /> is set to a Unicode encoding other than UTF-8.</exception>
262 <exception cref="T:System.ArgumentNullException">
263 <paramref name="archiveFileName" /> is <see langword="null" />.</exception>
264 <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.</exception>
265 <exception cref="T:System.IO.DirectoryNotFoundException">
266 <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
267 <exception cref="T:System.IO.IOException">
268 <paramref name="archiveFileName" /> could not be opened.
270 <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>
271 <exception cref="T:System.UnauthorizedAccessException">
272 <paramref name="archiveFileName" /> specifies a directory.
274 The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
275 <exception cref="T:System.ArgumentOutOfRangeException">
276 <paramref name="mode" /> specifies an invalid value.</exception>
277 <exception cref="T:System.IO.FileNotFoundException">
278 <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>
279 <exception cref="T:System.NotSupportedException">
280 <paramref name="archiveFileName" /> contains an invalid format.</exception>
281 <exception cref="T:System.IO.InvalidDataException">
282 <paramref name="archiveFileName" /> could not be interpreted as a zip archive.
284 <paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is missing or corrupt and cannot be read.
286 <paramref name="mode" /> is <see cref="F:System.IO.Compression.ZipArchiveMode.Update" />, but an entry is too large to fit into memory.</exception>
288 <member name="M:System.IO.Compression.ZipFile.OpenRead(System.String)">
289 <summary>Opens a zip archive for reading at the specified path.</summary>
290 <param name="archiveFileName">The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.</param>
291 <returns>The opened zip archive.</returns>
292 <exception cref="T:System.ArgumentException">
293 <paramref name="archiveFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
294 <exception cref="T:System.ArgumentNullException">
295 <paramref name="archiveFileName" /> is <see langword="null" />.</exception>
296 <exception cref="T:System.IO.PathTooLongException">In <paramref name="archiveFileName" />, the specified path, file name, or both exceed the system-defined maximum length.</exception>
297 <exception cref="T:System.IO.DirectoryNotFoundException">
298 <paramref name="archiveFileName" /> is invalid or does not exist (for example, it is on an unmapped drive).</exception>
299 <exception cref="T:System.IO.IOException">
300 <paramref name="archiveFileName" /> could not be opened.</exception>
301 <exception cref="T:System.UnauthorizedAccessException">
302 <paramref name="archiveFileName" /> specifies a directory.
304 The caller does not have the required permission to access the file specified in <paramref name="archiveFileName" />.</exception>
305 <exception cref="T:System.IO.FileNotFoundException">The file specified in <paramref name="archiveFileName" /> is not found.</exception>
306 <exception cref="T:System.NotSupportedException">
307 <paramref name="archiveFileName" /> contains an invalid format.</exception>
308 <exception cref="T:System.IO.InvalidDataException">
309 <paramref name="archiveFileName" /> could not be interpreted as a zip archive.</exception>
311 <member name="T:System.IO.Compression.ZipFileExtensions">
312 <summary>Provides extension methods for the <see cref="T:System.IO.Compression.ZipArchive" /> and <see cref="T:System.IO.Compression.ZipArchiveEntry" /> classes.</summary>
314 <member name="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String)">
315 <summary>Archives a file by compressing it and adding it to the zip archive.</summary>
316 <param name="destination">The zip archive to add the file to.</param>
317 <param name="sourceFileName">The path to the file to be archived. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory.</param>
318 <param name="entryName">The name of the entry to create in the zip archive.</param>
319 <returns>A wrapper for the new entry in the zip archive.</returns>
320 <exception cref="T:System.ArgumentException">
321 <paramref name="sourceFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
323 <paramref name="entryName" /> is <see cref="F:System.String.Empty" />.</exception>
324 <exception cref="T:System.ArgumentNullException">
325 <paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
326 <exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length.</exception>
327 <exception cref="T:System.IO.DirectoryNotFoundException">
328 <paramref name="sourceFileName" /> is invalid (for example, it is on an unmapped drive).</exception>
329 <exception cref="T:System.IO.IOException">The file specified by <paramref name="sourceFileName" /> cannot be opened, or is too large to be updated (current limit is Int32.MaxValue).</exception>
330 <exception cref="T:System.UnauthorizedAccessException">
331 <paramref name="sourceFileName" /> specifies a directory.
333 The caller does not have the required permission to access the file specified by <paramref name="sourceFileName" />.</exception>
334 <exception cref="T:System.IO.FileNotFoundException">The file specified by <paramref name="sourceFileName" /> is not found.</exception>
335 <exception cref="T:System.NotSupportedException">The <paramref name="sourceFileName" /> parameter is in an invalid format.
337 The zip archive does not support writing.</exception>
338 <exception cref="T:System.ObjectDisposedException">The zip archive has been disposed.</exception>
340 <member name="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String,System.IO.Compression.CompressionLevel)">
341 <summary>Archives a file by compressing it using the specified compression level and adding it to the zip archive.</summary>
342 <param name="destination">The zip archive to add the file to.</param>
343 <param name="sourceFileName">The path to the file to be archived. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory.</param>
344 <param name="entryName">The name of the entry to create in the zip archive.</param>
345 <param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry.</param>
346 <returns>A wrapper for the new entry in the zip archive.</returns>
347 <exception cref="T:System.ArgumentException">
348 <paramref name="sourceFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
350 <paramref name="entryName" /> is <see cref="F:System.String.Empty" />.</exception>
351 <exception cref="T:System.ArgumentNullException">
352 <paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
353 <exception cref="T:System.IO.DirectoryNotFoundException">
354 <paramref name="sourceFileName" /> is invalid (for example, it is on an unmapped drive).</exception>
355 <exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length.</exception>
356 <exception cref="T:System.IO.IOException">The file specified by <paramref name="sourceFileName" /> cannot be opened, or is too large to be updated (current limit is Int32.MaxValue).</exception>
357 <exception cref="T:System.UnauthorizedAccessException">
358 <paramref name="sourceFileName" /> specifies a directory.
360 The caller does not have the required permission to access the file specified by <paramref name="sourceFileName" />.</exception>
361 <exception cref="T:System.IO.FileNotFoundException">The file specified by <paramref name="sourceFileName" /> is not found.</exception>
362 <exception cref="T:System.NotSupportedException">The <paramref name="sourceFileName" /> parameter is in an invalid format.
364 The zip archive does not support writing.</exception>
365 <exception cref="T:System.ObjectDisposedException">The zip archive has been disposed.</exception>
367 <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive,System.String)">
368 <summary>Extracts all the files in the zip archive to a directory on the file system.</summary>
369 <param name="source">The zip archive to extract files from.</param>
370 <param name="destinationDirectoryName">The path to the directory to place the extracted files in. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory.</param>
371 <exception cref="T:System.ArgumentException">
372 <paramref name="destinationDirectoryName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
373 <exception cref="T:System.ArgumentNullException">
374 <paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
375 <exception cref="T:System.IO.PathTooLongException">The specified path exceeds the system-defined maximum length.</exception>
376 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
377 <exception cref="T:System.IO.IOException">The directory specified by <paramref name="destinationDirectoryName" /> already exists.
379 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.
381 Extracting an entry from the archive 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.)
383 Two or more entries in the archive have the same name.</exception>
384 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to write to the destination directory.</exception>
385 <exception cref="T:System.NotSupportedException">
386 <paramref name="destinationDirectoryName" /> contains an invalid format.</exception>
387 <exception cref="T:System.IO.InvalidDataException">An archive entry cannot be found or is corrupt.
389 An archive entry was compressed by using a compression method that is not supported.</exception>
391 <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive,System.String,System.Boolean)">
392 <summary>Extracts all of the files in the archive to a directory on the file system.</summary>
393 <param name="source">The <see cref="T:System.IO.Compression.ZipArchive" /> to extract.</param>
394 <param name="destinationDirectoryName">The path to the destination directory on the file system. The path can be relative or absolute. A relative path is interpreted as relative to the current working directory.</param>
395 <param name="overwriteFiles">
396 <see langword="true" /> to indicate that existing files are to be overwritten; <see langword="false" /> otherwise.</param>
397 <exception cref="T:System.ArgumentException">
398 <paramref name="destinationArchiveFileName" /> is a zero-length string, contains only whitespace,
399 or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.</exception>
400 <exception cref="T:System.ArgumentNullException">
401 <paramref name="destinationArchiveFileName" /> is <see langword="null" />.</exception>
402 <exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length.</exception>
403 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid, (for example, it is on an unmapped drive).</exception>
404 <exception cref="T:System.IO.IOException">The name of a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> is zero-length, contains only whitespace, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
406 Extracting a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> would have resulted in a destination file that is outside <paramref name="destinationArchiveFileName" /> (for example, if the entry name contains parent directory accessors).
408 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has the same name as an already extracted entry from the same archive.</exception>
409 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
410 <exception cref="T:System.NotSupportedException">
411 <paramref name="destinationArchiveFileName" /> is in an invalid format.</exception>
412 <exception cref="T:System.IO.InvalidDataException">A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> was not found or was corrupt.
414 A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed using a compression method that is not supported.</exception>
416 <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String)">
417 <summary>Extracts an entry in the zip archive to a file.</summary>
418 <param name="source">The zip archive entry to extract a file from.</param>
419 <param name="destinationFileName">The path of the file to create from the contents of the entry. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory.</param>
420 <exception cref="T:System.ArgumentException">
421 <paramref name="destinationFileName" /> is a zero-length string, contains only white space, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
423 <paramref name="destinationFileName" /> specifies a directory.</exception>
424 <exception cref="T:System.ArgumentNullException">
425 <paramref name="destinationFileName" /> is <see langword="null" />.</exception>
426 <exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length.</exception>
427 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
428 <exception cref="T:System.IO.IOException">
429 <paramref name="destinationFileName" /> already exists.
431 An I/O error occurred.
433 The entry is currently open for writing.
435 The entry has been deleted from the archive.</exception>
436 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to create the new file.</exception>
437 <exception cref="T:System.IO.InvalidDataException">The entry is missing from the archive, or is corrupt and cannot be read.
439 The entry has been compressed by using a compression method that is not supported.</exception>
440 <exception cref="T:System.ObjectDisposedException">The zip archive that this entry belongs to has been disposed.</exception>
441 <exception cref="T:System.NotSupportedException">
442 <paramref name="destinationFileName" /> is in an invalid format.
444 The zip archive for this entry was opened in <see cref="F:System.IO.Compression.ZipArchiveMode.Create" /> mode, which does not permit the retrieval of entries.</exception>
446 <member name="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String,System.Boolean)">
447 <summary>Extracts an entry in the zip archive to a file, and optionally overwrites an existing file that has the same name.</summary>
448 <param name="source">The zip archive entry to extract a file from.</param>
449 <param name="destinationFileName">The path of the file to create from the contents of the entry. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory.</param>
450 <param name="overwrite">
451 <see langword="true" /> to overwrite an existing file that has the same name as the destination file; otherwise, <see langword="false" />.</param>
452 <exception cref="T:System.ArgumentException">
453 <paramref name="destinationFileName" /> is a zero-length string, contains only white space, or contains one or more invalid characters as defined by <see cref="F:System.IO.Path.InvalidPathChars" />.
455 <paramref name="destinationFileName" /> specifies a directory.</exception>
456 <exception cref="T:System.ArgumentNullException">
457 <paramref name="destinationFileName" /> is <see langword="null" />.</exception>
458 <exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length.</exception>
459 <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
460 <exception cref="T:System.IO.IOException">
461 <paramref name="destinationFileName" /> already exists and <paramref name="overwrite" /> is <see langword="false" />.
463 An I/O error occurred.
465 The entry is currently open for writing.
467 The entry has been deleted from the archive.</exception>
468 <exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to create the new file.</exception>
469 <exception cref="T:System.IO.InvalidDataException">The entry is missing from the archive or is corrupt and cannot be read.
471 The entry has been compressed by using a compression method that is not supported.</exception>
472 <exception cref="T:System.ObjectDisposedException">The zip archive that this entry belongs to has been disposed.</exception>
473 <exception cref="T:System.NotSupportedException">
474 <paramref name="destinationFileName" /> is in an invalid format.
476 The zip archive for this entry was opened in <see cref="F:System.IO.Compression.ZipArchiveMode.Create" /> mode, which does not permit the retrieval of entries.</exception>