You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: xml/System.IO.Compression/ZipArchive.xml
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -503,7 +503,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
503
503
## Remarks
504
504
The `entryName` string should reflect the relative path of the entry you want to create within the zip archive. There is no restriction on the string you provide. However, if it is not formatted as a relative path, the entry is created, but you may get an exception when you extract the contents of the zip archive. If an entry with the specified path and name already exists in the archive, a second entry is created with the same path and name.
505
505
506
-
The value of the <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property for the new entry is set to the current time. The entry is compressed using the default compression level of the underlying compression algorithm. If you want to specify a different compression level, use the <xref:System.IO.Compression.ZipArchive.CreateEntry%2A> method.
506
+
The value of the <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property for the new entry is set to the current time. The entry is compressed using the default compression level of the underlying compression algorithm. If you want to specify a different compression level, use the <xref:System.IO.Compression.ZipArchive.CreateEntry*> method.
507
507
508
508
## Examples
509
509
The following example shows how to create an entry and write to it by using a stream.
@@ -640,11 +640,11 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
640
640
<formattype="text/markdown"><.
647
+
<xref:System.IO.Compression.ZipArchive.Dispose> calls the <xref:System.IO.Compression.ZipArchive.Dispose(System.Boolean)> method, which contains the code to release managed and unmanaged resources. For more information, see [Implementing a Dispose method](/dotnet/standard/garbage-collection/implementing-dispose).
648
648
649
649
]]></format>
650
650
</remarks>
@@ -692,15 +692,15 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
692
692
<formattype="text/markdown"><.
706
706
@@ -801,7 +801,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
801
801
<formattype="text/markdown"><![CDATA[
802
802
803
803
## Remarks
804
-
Use the <xref:System.IO.Compression.ZipArchive.Entries> property to retrieve the entire collection of entries. Use the <xref:System.IO.Compression.ZipArchive.GetEntry%2A> method to retrieve a single entry by name.
804
+
Use the <xref:System.IO.Compression.ZipArchive.Entries> property to retrieve the entire collection of entries. Use the <xref:System.IO.Compression.ZipArchive.GetEntry*> method to retrieve a single entry by name.
805
805
806
806
## Examples
807
807
The following example shows how to open a zip archive and iterate through the collection of entries.
@@ -863,7 +863,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
863
863
If multiple entries that have the specified name exist in the archive, the first one is returned. The name of the entry is compared to `entryName` using ordinal comparison.
864
864
865
865
## Examples
866
-
The following example shows how to use the <xref:System.IO.Compression.ZipArchive.GetEntry%2A> method to retrieve an entry.
866
+
The following example shows how to use the <xref:System.IO.Compression.ZipArchive.GetEntry*> method to retrieve an entry.
@@ -918,7 +918,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
918
918
<formattype="text/markdown"><![CDATA[
919
919
920
920
## Remarks
921
-
You specify a value for the <xref:System.IO.Compression.ZipArchive> property when you create an instance of the <xref:System.IO.Compression.ZipArchive> class. Use the <xref:System.IO.Compression.ZipArchive.%23ctor%28System.IO.Stream%2CSystem.IO.Compression.ZipArchiveMode%29> or <xref:System.IO.Compression.ZipArchive.%23ctor%28System.IO.Stream%2CSystem.IO.Compression.ZipArchiveMode%2CSystem.Boolean%29> constructor to provide a value for the <xref:System.IO.Compression.ZipArchive.Mode> property.
921
+
You specify a value for the <xref:System.IO.Compression.ZipArchive> property when you create an instance of the <xref:System.IO.Compression.ZipArchive> class. Use the <xref:System.IO.Compression.ZipArchive.%23ctor(System.IO.Stream,System.IO.Compression.ZipArchiveMode)> or <xref:System.IO.Compression.ZipArchive.%23ctor(System.IO.Stream,System.IO.Compression.ZipArchiveMode,System.Boolean)> constructor to provide a value for the <xref:System.IO.Compression.ZipArchive.Mode> property.
Copy file name to clipboardExpand all lines: xml/System.IO.Compression/ZipArchiveEntry.xml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -172,7 +172,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
172
172
This property cannot be retrieved when the mode is set to <xref:System.IO.Compression.ZipArchiveMode.Create>, or the mode is set to <xref:System.IO.Compression.ZipArchiveMode.Update> and the entry has been opened.
173
173
174
174
## Examples
175
-
The following example shows how to retrieve entries in a zip archive, and evaluate the properties of the entries. It uses the <xref:System.IO.Compression.ZipArchiveEntry.Name> property to display the name of the entry, and the <xref:System.IO.Compression.ZipArchiveEntry.Length%2A> and <xref:System.IO.Compression.ZipArchiveEntry.CompressedLength%2A> properties to calculate how much the file was compressed.
175
+
The following example shows how to retrieve entries in a zip archive, and evaluate the properties of the entries. It uses the <xref:System.IO.Compression.ZipArchiveEntry.Name> property to display the name of the entry, and the <xref:System.IO.Compression.ZipArchiveEntry.Length*> and <xref:System.IO.Compression.ZipArchiveEntry.CompressedLength*> properties to calculate how much the file was compressed.
@@ -488,7 +488,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
488
488
This property cannot be retrieved when the mode is set to <xref:System.IO.Compression.ZipArchiveMode.Create>, or the mode is set to <xref:System.IO.Compression.ZipArchiveMode.Update> and the entry has been opened.
489
489
490
490
## Examples
491
-
The following example shows how to retrieve entries from a zip archive, and evaluate the properties of the entries. It uses the <xref:System.IO.Compression.ZipArchiveEntry.Name> property to display the name of the entry, and the <xref:System.IO.Compression.ZipArchiveEntry.Length%2A> and <xref:System.IO.Compression.ZipArchiveEntry.CompressedLength%2A> properties to calculate how much the file was compressed.
491
+
The following example shows how to retrieve entries from a zip archive, and evaluate the properties of the entries. It uses the <xref:System.IO.Compression.ZipArchiveEntry.Name> property to display the name of the entry, and the <xref:System.IO.Compression.ZipArchiveEntry.Length*> and <xref:System.IO.Compression.ZipArchiveEntry.CompressedLength*> properties to calculate how much the file was compressed.
@@ -583,7 +583,7 @@ If the comment byte length is larger than <xref:System.UInt16.MaxValue>, it will
583
583
You use this method to access the stream for an entry in a zip archive. After retrieving the stream, you can read from or write to the stream. When you write to the stream, the modifications you make to the entry will appear in the zip archive.
584
584
585
585
## Examples
586
-
The following example shows how to create a new entry, open it with the <xref:System.IO.Compression.ZipArchiveEntry.Open%2A> method, and write to the stream.
586
+
The following example shows how to create a new entry, open it with the <xref:System.IO.Compression.ZipArchiveEntry.Open*> method, and write to the stream.
Copy file name to clipboardExpand all lines: xml/System.IO.Compression/ZipFile.xml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -171,7 +171,7 @@ An I/O error occurred while opening a file to be archived.</exception>
171
171
<formattype="text/markdown"><![CDATA[
172
172
173
173
## Remarks
174
-
The directory structure from the file system is preserved in the archive. If the directory is empty, an empty archive is created. This method overload does not include the base directory in the archive and does not allow you to specify a compression level. If you want to include the base directory or specify a compression level, call the <xref:System.IO.Compression.ZipFile.CreateFromDirectory%28System.String%2CSystem.String%2CSystem.IO.Compression.CompressionLevel%2CSystem.Boolean%29> method overload.
174
+
The directory structure from the file system is preserved in the archive. If the directory is empty, an empty archive is created. This method overload does not include the base directory in the archive and does not allow you to specify a compression level. If you want to include the base directory or specify a compression level, call the <xref:System.IO.Compression.ZipFile.CreateFromDirectory(System.String,System.String,System.IO.Compression.CompressionLevel,System.Boolean)> method overload.
175
175
176
176
If the archive already exists, an <xref:System.IO.IOException> exception is thrown. If an entry with the specified name already exists in the archive, a second entry is created with an identical name.
177
177
@@ -2509,7 +2509,7 @@ An archive entry has been compressed using a compression method that isn't suppo
2509
2509
<formattype="text/markdown"><![CDATA[
2510
2510
2511
2511
## Remarks
2512
-
When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read>, the archive is opened with <xref:System.IO.FileMode.Open> from the <xref:System.IO.FileMode> enumeration as the file mode value. If the archive does not exist, a <xref:System.IO.FileNotFoundException> exception is thrown. Setting the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read> is equivalent to calling the <xref:System.IO.Compression.ZipFile.OpenRead%2A> method.
2512
+
When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read>, the archive is opened with <xref:System.IO.FileMode.Open> from the <xref:System.IO.FileMode> enumeration as the file mode value. If the archive does not exist, a <xref:System.IO.FileNotFoundException> exception is thrown. Setting the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read> is equivalent to calling the <xref:System.IO.Compression.ZipFile.OpenRead*> method.
2513
2513
2514
2514
When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Create>, the archive is opened with <xref:System.IO.FileMode.CreateNew?displayProperty=nameWithType> as the file mode value. If the archive already exists, an <xref:System.IO.IOException> is thrown.
2515
2515
@@ -2899,7 +2899,7 @@ An unspecified I/O error occurred while opening the file.</exception>
2899
2899
<remarks>
2900
2900
<formattype="text/markdown"><![CDATA[
2901
2901
2902
-
This method is equivalent to calling the <xref:System.IO.Compression.ZipFile.Open%2A> method and setting the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read>. The archive is opened with <xref:System.IO.FileMode.Open?displayProperty=nameWithType> as the file mode value. If the archive does not exist, a <xref:System.IO.FileNotFoundException> exception is thrown.
2902
+
This method is equivalent to calling the <xref:System.IO.Compression.ZipFile.Open*> method and setting the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Read>. The archive is opened with <xref:System.IO.FileMode.Open?displayProperty=nameWithType> as the file mode value. If the archive does not exist, a <xref:System.IO.FileNotFoundException> exception is thrown.
Copy file name to clipboardExpand all lines: xml/System.IO.Compression/ZipFileExtensions.xml
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -748,11 +748,11 @@ A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed usi
748
748
<formattype="text/markdown"><![CDATA[
749
749
750
750
## Remarks
751
-
If the destination file already exists, this method does not overwrite it; it throws an <xref:System.IO.IOException> exception. To overwrite an existing file, use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToFile%28System.IO.Compression.ZipArchiveEntry%2CSystem.String%2CSystem.Boolean%29> method overload instead.
751
+
If the destination file already exists, this method does not overwrite it; it throws an <xref:System.IO.IOException> exception. To overwrite an existing file, use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String,System.Boolean)> method overload instead.
752
752
753
753
The last write time of the file is set to the last time the entry in the zip archive was changed; this value is stored in the <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property.
754
754
755
-
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory%2A> method instead.
755
+
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory*> method instead.
756
756
757
757
## Examples
758
758
The following example shows how to iterate through the contents of a zip archive file and extract files that have a .txt extension.
@@ -854,7 +854,7 @@ A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed usi
854
854
## Remarks
855
855
The last write time of the file is set to the last time the entry in the zip archive was changed; this value is stored in the <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property.
856
856
857
-
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory%2A> method instead.
857
+
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory*> method instead.
858
858
859
859
## Examples
860
860
The following example shows how to iterate through the contents of a zip archive file, and extract files that have a .txt extension. It overwrites an existing file that has the same name in the destination folder. In order to compiler this code example, you must reference the `System.IO.Compression` and `System.IO.Compression.FileSystem` assemblies in your project.
0 commit comments