-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathZipFileExtensions.xml
More file actions
1058 lines (977 loc) · 78.5 KB
/
ZipFileExtensions.xml
File metadata and controls
1058 lines (977 loc) · 78.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<Type Name="ZipFileExtensions" FullName="System.IO.Compression.ZipFileExtensions">
<TypeSignature Language="C#" Value="public static class ZipFileExtensions" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit ZipFileExtensions extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.IO.Compression.ZipFileExtensions" />
<TypeSignature Language="VB.NET" Value="Public Module ZipFileExtensions" />
<TypeSignature Language="F#" Value="type ZipFileExtensions = class" />
<TypeSignature Language="C++ CLI" Value="public ref class ZipFileExtensions abstract sealed" />
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="10.0.0.0" FrameworkAlternate="net-10.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="11.0.0.0" FrameworkAlternate="net-11.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.IO.Compression.ZipFile" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="net-10.0;net-11.0;net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.Nullable(0)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.Nullable(0)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides extension methods for the <see cref="T:System.IO.Compression.ZipArchive" /> and <see cref="T:System.IO.Compression.ZipArchiveEntry" /> classes.</summary>
<remarks>
<format type="text/markdown"><]
]]></format>
</remarks>
</Docs>
<Members>
<MemberGroup MemberName="CreateEntryFromFile">
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Archives a file by compressing it and adding it to the zip archive.</summary>
</Docs>
</MemberGroup>
<Member MemberName="CreateEntryFromFile">
<MemberSignature Language="C#" Value="public static System.IO.Compression.ZipArchiveEntry CreateEntryFromFile (this System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.IO.Compression.ZipArchiveEntry CreateEntryFromFile(class System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function CreateEntryFromFile (destination As ZipArchive, sourceFileName As String, entryName As String) As ZipArchiveEntry" />
<MemberSignature Language="F#" Value="static member CreateEntryFromFile : System.IO.Compression.ZipArchive * string * string -> System.IO.Compression.ZipArchiveEntry" Usage="System.IO.Compression.ZipFileExtensions.CreateEntryFromFile (destination, sourceFileName, entryName)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static System::IO::Compression::ZipArchiveEntry ^ CreateEntryFromFile(System::IO::Compression::ZipArchive ^ destination, System::String ^ sourceFileName, System::String ^ entryName);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Compression.ZipArchiveEntry</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="destination" Type="System.IO.Compression.ZipArchive" RefType="this" />
<Parameter Name="sourceFileName" Type="System.String" />
<Parameter Name="entryName" Type="System.String" />
</Parameters>
<Docs>
<param name="destination">The zip archive to add the file to.</param>
<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>
<param name="entryName">The name of the entry to create in the zip archive.</param>
<summary>Archives a file by compressing it and adding it to the zip archive.</summary>
<returns>A wrapper for the new entry in the zip archive.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The new entry in the archive contains the contents of the file specified by `sourceFileName`. If an entry with the specified name (`entryName`) already exists in the archive, a second entry is created with an identical name. The <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property of the entry is set to the last time the file on the file system was changed.
When `ZipArchiveMode.Update` is present, the size limit of an entry is limited to <xref:System.Int32.MaxValue?displayProperty=nameWithType>. This limit is because update mode uses a <xref:System.IO.MemoryStream> internally to allow the seeking required when updating an archive, and <xref:System.IO.MemoryStream> has a maximum equal to the size of an int.
## Examples
The following example shows how to create a new entry in a zip archive from an existing file.
:::code language="csharp" source="~/snippets/csharp/System.IO.Compression/ZipArchive/Entries/program3.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.IO.Compression/ZipArchive/Entries/program3.vb" id="Snippet3":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="sourceFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
-or-
<paramref name="entryName" /> is <see cref="F:System.String.Empty" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length. </exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<paramref name="sourceFileName" /> is invalid (for example, it is on an unmapped drive).</exception>
<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 <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<paramref name="sourceFileName" /> specifies a directory.
-or-
The caller does not have the required permission to access the file specified by <paramref name="sourceFileName" />.</exception>
<exception cref="T:System.IO.FileNotFoundException">The file specified by <paramref name="sourceFileName" /> is not found.</exception>
<exception cref="T:System.NotSupportedException">The <paramref name="sourceFileName" /> parameter is in an invalid format.
-or-
The zip archive does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">The zip archive has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="CreateEntryFromFile">
<MemberSignature Language="C#" Value="public static System.IO.Compression.ZipArchiveEntry CreateEntryFromFile (this System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, System.IO.Compression.CompressionLevel compressionLevel);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.IO.Compression.ZipArchiveEntry CreateEntryFromFile(class System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, valuetype System.IO.Compression.CompressionLevel compressionLevel) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFile(System.IO.Compression.ZipArchive,System.String,System.String,System.IO.Compression.CompressionLevel)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function CreateEntryFromFile (destination As ZipArchive, sourceFileName As String, entryName As String, compressionLevel As CompressionLevel) As ZipArchiveEntry" />
<MemberSignature Language="F#" Value="static member CreateEntryFromFile : System.IO.Compression.ZipArchive * string * string * System.IO.Compression.CompressionLevel -> System.IO.Compression.ZipArchiveEntry" Usage="System.IO.Compression.ZipFileExtensions.CreateEntryFromFile (destination, sourceFileName, entryName, compressionLevel)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static System::IO::Compression::ZipArchiveEntry ^ CreateEntryFromFile(System::IO::Compression::ZipArchive ^ destination, System::String ^ sourceFileName, System::String ^ entryName, System::IO::Compression::CompressionLevel compressionLevel);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Compression.ZipArchiveEntry</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="destination" Type="System.IO.Compression.ZipArchive" RefType="this" />
<Parameter Name="sourceFileName" Type="System.String" />
<Parameter Name="entryName" Type="System.String" />
<Parameter Name="compressionLevel" Type="System.IO.Compression.CompressionLevel" />
</Parameters>
<Docs>
<param name="destination">The zip archive to add the file to.</param>
<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>
<param name="entryName">The name of the entry to create in the zip archive.</param>
<param name="compressionLevel">One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry.</param>
<summary>Archives a file by compressing it using the specified compression level and adding it to the zip archive.</summary>
<returns>A wrapper for the new entry in the zip archive.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The new entry in the archive contains the contents of the file specified by `sourceFileName`. If an entry with the specified name (`entryName`) already exists in the archive, a second entry is created with an identical name. The <xref:System.IO.Compression.ZipArchiveEntry.LastWriteTime> property of the entry is set to the last time the file on the file system was changed.
When `ZipArchiveMode.Update` is present, the size limit of an entry is limited to <xref:System.Int32.MaxValue?displayProperty=nameWithType>. This limit is because update mode uses a <xref:System.IO.MemoryStream> internally to allow the seeking required when updating an archive, and <xref:System.IO.MemoryStream> has a maximum equal to the size of an int.
## Examples
The following example shows how to create a new entry in a zip archive from an existing file, and specify the compression level.
:::code language="csharp" source="~/snippets/csharp/System.IO.Compression/ZipArchive/Entries/program4.cs" id="Snippet4":::
:::code language="vb" source="~/snippets/visualbasic/System.IO.Compression/ZipArchive/Entries/program4.vb" id="Snippet4":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="sourceFileName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.
-or-
<paramref name="entryName" /> is <see cref="F:System.String.Empty" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<paramref name="sourceFileName" /> is invalid (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.PathTooLongException">In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length. </exception>
<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 <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see>.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<paramref name="sourceFileName" /> specifies a directory.
-or-
The caller does not have the required permission to access the file specified by <paramref name="sourceFileName" />.</exception>
<exception cref="T:System.IO.FileNotFoundException">The file specified by <paramref name="sourceFileName" /> is not found.</exception>
<exception cref="T:System.NotSupportedException">The <paramref name="sourceFileName" /> parameter is in an invalid format.
-or-
The zip archive does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">The zip archive has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="CreateEntryFromFileAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry> CreateEntryFromFileAsync (this System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task`1<class System.IO.Compression.ZipArchiveEntry> CreateEntryFromFileAsync(class System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFileAsync(System.IO.Compression.ZipArchive,System.String,System.String,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function CreateEntryFromFileAsync (destination As ZipArchive, sourceFileName As String, entryName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ZipArchiveEntry)" />
<MemberSignature Language="F#" Value="static member CreateEntryFromFileAsync : System.IO.Compression.ZipArchive * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry>" Usage="System.IO.Compression.ZipFileExtensions.CreateEntryFromFileAsync (destination, sourceFileName, entryName, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="destination" Type="System.IO.Compression.ZipArchive" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="sourceFileName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="entryName" Type="System.String" Index="2" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="3" FrameworkAlternate="net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="destination">The zip archive to add the file to.</param>
<param name="sourceFileName">
<para>The path to the file on the file system to be copied from. The path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.</para>
</param>
<param name="entryName">The name of the entry to be created.</param>
<param name="cancellationToken">The cancellation token to monitor for cancellation requests.</param>
<summary> Asynchronously adds a file from the file system to the archive under the specified entry name.
</summary>
<returns>A wrapper for the newly created entry.</returns>
<remarks>
<para>The new entry in the archive will contain the contents of the file.</para>
<para>The last write time of the archive entry is set to the last write time of the file on the file system.</para>
<para>If an entry with the specified name already exists in the archive, a second entry will be created that has an identical name.</para>
<para>If the specified source file has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used. If an entry with the specified name already exists in the archive, a second entry will be created that has an identical name. Since no <code>CompressionLevel</code> is specified, the default provided by the implementation of the underlying compression algorithm will be used; the <code>ZipArchive</code> will not impose its own default.</para>
<para>(Currently, the underlying compression algorithm is provided by the <see cref="T:System.IO.Compression.DeflateStream" /> class.)</para>
</remarks>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="sourceFileName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>-or-</para>
<para>
<paramref name="entryName" /> is a zero-length string.</para>
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">
<para>In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.</para>
</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified <paramref name="sourceFileName" /> is invalid, (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred while opening the file specified by <paramref name="sourceFileName" />.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<para>
<paramref name="sourceFileName" /> specified a directory.</para>
<para>-or-</para>
<para>The caller does not have the required permission.</para>
</exception>
<exception cref="T:System.IO.FileNotFoundException">The file specified in <paramref name="sourceFileName" /> was not found.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="sourceFileName" /> is in an invalid format or the ZipArchive does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">The ZipArchive has already been closed.</exception>
<exception cref="T:System.OperationCanceledException">An asynchronous operation is cancelled.</exception>
</Docs>
</Member>
<Member MemberName="CreateEntryFromFileAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry> CreateEntryFromFileAsync (this System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, System.IO.Compression.CompressionLevel compressionLevel, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task`1<class System.IO.Compression.ZipArchiveEntry> CreateEntryFromFileAsync(class System.IO.Compression.ZipArchive destination, string sourceFileName, string entryName, valuetype System.IO.Compression.CompressionLevel compressionLevel, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.CreateEntryFromFileAsync(System.IO.Compression.ZipArchive,System.String,System.String,System.IO.Compression.CompressionLevel,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function CreateEntryFromFileAsync (destination As ZipArchive, sourceFileName As String, entryName As String, compressionLevel As CompressionLevel, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ZipArchiveEntry)" />
<MemberSignature Language="F#" Value="static member CreateEntryFromFileAsync : System.IO.Compression.ZipArchive * string * string * System.IO.Compression.CompressionLevel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry>" Usage="System.IO.Compression.ZipFileExtensions.CreateEntryFromFileAsync (destination, sourceFileName, entryName, compressionLevel, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task<System.IO.Compression.ZipArchiveEntry></ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="destination" Type="System.IO.Compression.ZipArchive" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="sourceFileName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="entryName" Type="System.String" Index="2" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="compressionLevel" Type="System.IO.Compression.CompressionLevel" Index="3" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="4" FrameworkAlternate="net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="destination">The zip archive to add the file to.</param>
<param name="sourceFileName">
<para>The path to the file on the file system to be copied from. The path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.</para>
</param>
<param name="entryName">The name of the entry to be created.</param>
<param name="compressionLevel">The level of the compression (speed/memory vs. compressed size trade-off).</param>
<param name="cancellationToken">The cancellation token to monitor for cancellation requests.</param>
<summary>Asynchronously adds a file from the file system to the archive under the specified entry name.
</summary>
<returns>A wrapper for the newly created entry.</returns>
<remarks>
<para>The new entry in the archive will contain the contents of the file.</para>
<para>The last write time of the archive entry is set to the last write time of the file on the file system.</para>
<para>If an entry with the specified name already exists in the archive, a second entry will be created that has an identical name.</para>
<para>If the specified source file has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used. If an entry with the specified name already exists in the archive, a second entry will be created that has an identical name.</para>
</remarks>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="sourceFileName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>-or-</para>
<para>
<paramref name="entryName" /> is a zero-length string.</para>
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="sourceFileName" /> or <paramref name="entryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">
<para>In <paramref name="sourceFileName" />, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.</para>
</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified <paramref name="sourceFileName" /> is invalid, (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">An I/O error occurred while opening the file specified by <paramref name="sourceFileName" />.</exception>
<exception cref="T:System.UnauthorizedAccessException">
<para>
<paramref name="sourceFileName" /> specified a directory.</para>
<para>-or-</para>
<para>The caller does not have the required permission.</para>
</exception>
<exception cref="T:System.IO.FileNotFoundException">The file specified in <paramref name="sourceFileName" /> was not found.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="sourceFileName" /> is in an invalid format or the ZipArchive does not support writing.</exception>
<exception cref="T:System.ObjectDisposedException">The ZipArchive has already been closed.</exception>
<exception cref="T:System.OperationCanceledException">An asynchronous operation is cancelled.</exception>
</Docs>
</Member>
<Member MemberName="ExtractToDirectory">
<MemberSignature Language="C#" Value="public static void ExtractToDirectory (this System.IO.Compression.ZipArchive source, string destinationDirectoryName);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void ExtractToDirectory(class System.IO.Compression.ZipArchive source, string destinationDirectoryName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive,System.String)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Sub ExtractToDirectory (source As ZipArchive, destinationDirectoryName As String)" />
<MemberSignature Language="F#" Value="static member ExtractToDirectory : System.IO.Compression.ZipArchive * string -> unit" Usage="System.IO.Compression.ZipFileExtensions.ExtractToDirectory (source, destinationDirectoryName)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static void ExtractToDirectory(System::IO::Compression::ZipArchive ^ source, System::String ^ destinationDirectoryName);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchive" RefType="this" />
<Parameter Name="destinationDirectoryName" Type="System.String" />
</Parameters>
<Docs>
<param name="source">The zip archive to extract files from.</param>
<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>
<summary>Extracts all the files in the zip archive to a directory on the file system.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method creates the directory specified by `destinationDirectoryName`. The method also creates subdirectories that reflect the hierarchy in the zip archive. If an error occurs during extraction, the archive remains partially extracted. Each extracted file has the same relative path to the directory specified by `destinationDirectoryName` as its source entry has to the root of the archive.
## Examples
The following example shows how to create a new entry in a zip archive from an existing file, and extract the archive to a new directory.
:::code language="csharp" source="~/snippets/csharp/System.IO.Compression/ZipArchive/Entries/program3.cs" id="Snippet3":::
:::code language="vb" source="~/snippets/visualbasic/System.IO.Compression/ZipArchive/Entries/program3.vb" id="Snippet3":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="destinationDirectoryName" /> is <see cref="F:System.String.Empty" />, contains only white space, or contains at least one invalid character.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The specified path exceeds the system-defined maximum length. </exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">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 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.)
-or-
Two or more entries in the archive have the same name.</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to write to the destination directory.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationDirectoryName" /> contains an invalid format.</exception>
<exception cref="T:System.IO.InvalidDataException">An archive entry cannot be found or is corrupt.
-or-
An archive entry was compressed by using a compression method that is not supported.</exception>
</Docs>
</Member>
<Member MemberName="ExtractToDirectory">
<MemberSignature Language="C#" Value="public static void ExtractToDirectory (this System.IO.Compression.ZipArchive source, string destinationDirectoryName, bool overwriteFiles);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void ExtractToDirectory(class System.IO.Compression.ZipArchive source, string destinationDirectoryName, bool overwriteFiles) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectory(System.IO.Compression.ZipArchive,System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Sub ExtractToDirectory (source As ZipArchive, destinationDirectoryName As String, overwriteFiles As Boolean)" />
<MemberSignature Language="F#" Value="static member ExtractToDirectory : System.IO.Compression.ZipArchive * string * bool -> unit" Usage="System.IO.Compression.ZipFileExtensions.ExtractToDirectory (source, destinationDirectoryName, overwriteFiles)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static void ExtractToDirectory(System::IO::Compression::ZipArchive ^ source, System::String ^ destinationDirectoryName, bool overwriteFiles);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchive" RefType="this" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;net-10.0;net-11.0" />
<Parameter Name="destinationDirectoryName" Type="System.String" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;net-10.0;net-11.0" />
<Parameter Name="overwriteFiles" Type="System.Boolean" Index="2" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netstandard-2.1;netcore-3.1;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0;net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="source">The <see cref="T:System.IO.Compression.ZipArchive" /> to extract.</param>
<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>
<param name="overwriteFiles">
<see langword="true" /> to overwrite existing files; <see langword="false" /> otherwise.</param>
<summary>Extracts all of the files in the archive to a directory on the file system. </summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The specified directory may already exist. This method creates the specified directory and all subdirectories if necessary.
If there is an error while extracting the archive, the archive will remain partially extracted.
Each entry is extracted such that the extracted file has the same relative path to `destinationDirectoryName` as the entry has to the root of the archive.
If a file to be archived has an invalid last modified time, the first date and time representable in the Zip timestamp format (midnight on January 1, 1980) is used.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<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>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length. </exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
<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" />.
-or-
Extracting a <see cref="T:System.IO.Compression.ZipArchiveEntry" /> would have resulted in a destination file that is outside <paramref name="destinationDirectoryName" /> (for example, if the entry name contains parent directory accessors).
-or-
A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has the same name as an already extracted entry from the same archive.</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationDirectoryName" /> is in an invalid format.</exception>
<exception cref="T:System.IO.InvalidDataException">A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> was not found or was corrupt.
-or-
A <see cref="T:System.IO.Compression.ZipArchiveEntry" /> has been compressed using a compression method that is not supported.</exception>
</Docs>
</Member>
<Member MemberName="ExtractToDirectoryAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task ExtractToDirectoryAsync (this System.IO.Compression.ZipArchive source, string destinationDirectoryName, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task ExtractToDirectoryAsync(class System.IO.Compression.ZipArchive source, string destinationDirectoryName, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectoryAsync(System.IO.Compression.ZipArchive,System.String,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function ExtractToDirectoryAsync (source As ZipArchive, destinationDirectoryName As String, Optional cancellationToken As CancellationToken = Nothing) As Task" />
<MemberSignature Language="F#" Value="static member ExtractToDirectoryAsync : System.IO.Compression.ZipArchive * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task" Usage="System.IO.Compression.ZipFileExtensions.ExtractToDirectoryAsync (source, destinationDirectoryName, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchive" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="destinationDirectoryName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="2" FrameworkAlternate="net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="source">The zip archive to extract files from.</param>
<param name="destinationDirectoryName">The path to the directory on the file system.</param>
<param name="cancellationToken">The cancellation token to monitor for cancellation requests.</param>
<summary>
<para>Asynchronously extracts all of the files in the archive to a directory on the file system. The specified directory can already exist.</para>
</summary>
<returns>To be added.</returns>
<remarks>
<para>The directory specified must not exist. The path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.</para>
<para>This method creates all subdirectories and the specified directory if necessary.</para>
<para>If there is an error while extracting the archive, the archive remains partially extracted.</para>
<para>Each entry is extracted such that the extracted file has the same relative path to <paramref name="destinationDirectoryName" /> as the entry has to the root of the archive. If a file to be archived has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used.</para>
</remarks>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="destinationDirectoryName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">
<para>The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.</para>
</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid, (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">
<para>An archive entry's name is zero-length, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>-or-</para>
<para>Extracting an archive entry would have resulted in a destination file that is outside <paramref name="destinationDirectoryName" /> (for example, if the entry name contains parent directory accessors).</para>
<para>-or-</para>
<para>An archive entry has the same name as an already extracted entry from the same archive.</para>
</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationDirectoryName" /> is in an invalid format.</exception>
<exception cref="T:System.IO.InvalidDataException">
<para>An archive entry was not found or is corrupt.</para>
<para>-or-</para>
<para>An archive entry has been compressed using a compression method that is not supported.</para>
</exception>
<exception cref="T:System.OperationCanceledException">An asynchronous operation is cancelled.</exception>
</Docs>
</Member>
<Member MemberName="ExtractToDirectoryAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task ExtractToDirectoryAsync (this System.IO.Compression.ZipArchive source, string destinationDirectoryName, bool overwriteFiles, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task ExtractToDirectoryAsync(class System.IO.Compression.ZipArchive source, string destinationDirectoryName, bool overwriteFiles, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToDirectoryAsync(System.IO.Compression.ZipArchive,System.String,System.Boolean,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function ExtractToDirectoryAsync (source As ZipArchive, destinationDirectoryName As String, overwriteFiles As Boolean, Optional cancellationToken As CancellationToken = Nothing) As Task" />
<MemberSignature Language="F#" Value="static member ExtractToDirectoryAsync : System.IO.Compression.ZipArchive * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task" Usage="System.IO.Compression.ZipFileExtensions.ExtractToDirectoryAsync (source, destinationDirectoryName, overwriteFiles, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchive" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="destinationDirectoryName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="overwriteFiles" Type="System.Boolean" Index="2" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="3" FrameworkAlternate="net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="source">The zip archive to extract files from.</param>
<param name="destinationDirectoryName">The path to the directory on the file system.</param>
<param name="overwriteFiles">
<see langword="true" /> to overwrite files; <see langword="false" /> otherwise.</param>
<param name="cancellationToken">The cancellation token to monitor for cancellation requests.</param>
<summary>Extracts all of the files in the archive to a directory on the file system. The specified directory may already exist.</summary>
<returns>To be added.</returns>
<remarks>
<para>The directory specified must not exist. The path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.</para>
</remarks>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="destinationDirectoryName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>This method will create all subdirectories and the specified directory if necessary.</para>
<para>If there is an error while extracting the archive, the archive will remain partially extracted.</para>
<para>Each entry is extracted such that the extracted file has the same relative path to <paramref name="destinationDirectoryName" /> as the entry has to the root of the archive. If a file to be archived has an invalid last modified time, the first datetime representable in the Zip timestamp format (midnight on January 1, 1980) will be used.</para>
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationDirectoryName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">
<para>The specified path, file name, or both exceed the system-defined maximum length.</para>
<para>For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.</para>
</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid, (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">
<para>An archive entry's name is zero-length, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>-or-</para>
<para>Extracting an archive entry would have resulted in a destination file that is outside <paramref name="destinationDirectoryName" /> (for example, if the entry name contains parent directory accessors).</para>
<para>-or-</para>
<para>An archive entry has the same name as an already extracted entry from the same archive.</para>
</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationDirectoryName" /> is in an invalid format.</exception>
<exception cref="T:System.IO.InvalidDataException">
<para>An archive entry was not found or was corrupt.</para>
<para>-or-</para>
<para>An archive entry has been compressed using a compression method that is not supported.</para>
</exception>
</Docs>
</Member>
<MemberGroup MemberName="ExtractToFile">
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Extracts an entry in the zip archive to a file.</summary>
</Docs>
</MemberGroup>
<Member MemberName="ExtractToFile">
<MemberSignature Language="C#" Value="public static void ExtractToFile (this System.IO.Compression.ZipArchiveEntry source, string destinationFileName);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void ExtractToFile(class System.IO.Compression.ZipArchiveEntry source, string destinationFileName) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Sub ExtractToFile (source As ZipArchiveEntry, destinationFileName As String)" />
<MemberSignature Language="F#" Value="static member ExtractToFile : System.IO.Compression.ZipArchiveEntry * string -> unit" Usage="System.IO.Compression.ZipFileExtensions.ExtractToFile (source, destinationFileName)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static void ExtractToFile(System::IO::Compression::ZipArchiveEntry ^ source, System::String ^ destinationFileName);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchiveEntry" RefType="this" />
<Parameter Name="destinationFileName" Type="System.String" />
</Parameters>
<Docs>
<param name="source">The zip archive entry to extract a file from.</param>
<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>
<summary>Extracts an entry in the zip archive to a file.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
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.
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory%2A> method instead.
## Examples
The following example shows how to iterate through the contents of a zip archive file and extract files that have a .txt extension.
:::code language="csharp" source="~/snippets/csharp/System.IO.Compression/ZipArchive/Entries/program1.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/System.IO.Compression/ZipArchive/Entries/program1.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<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" />.
-or-
<paramref name="destinationFileName" /> specifies a directory.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationFileName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length. </exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">
<paramref name="destinationFileName" /> already exists.
-or-
An I/O error occurred.
-or-
The entry is currently open for writing.
-or-
The entry has been deleted from the archive.</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to create the new file.</exception>
<exception cref="T:System.IO.InvalidDataException">The entry is missing from the archive, or is corrupt and cannot be read.
-or-
The entry has been compressed by using a compression method that is not supported.</exception>
<exception cref="T:System.ObjectDisposedException">The zip archive that this entry belongs to has been disposed.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationFileName" /> is in an invalid format.
-or-
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>
</Docs>
</Member>
<Member MemberName="ExtractToFile">
<MemberSignature Language="C#" Value="public static void ExtractToFile (this System.IO.Compression.ZipArchiveEntry source, string destinationFileName, bool overwrite);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void ExtractToFile(class System.IO.Compression.ZipArchiveEntry source, string destinationFileName, bool overwrite) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToFile(System.IO.Compression.ZipArchiveEntry,System.String,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Sub ExtractToFile (source As ZipArchiveEntry, destinationFileName As String, overwrite As Boolean)" />
<MemberSignature Language="F#" Value="static member ExtractToFile : System.IO.Compression.ZipArchiveEntry * string * bool -> unit" Usage="System.IO.Compression.ZipFileExtensions.ExtractToFile (source, destinationFileName, overwrite)" />
<MemberSignature Language="C++ CLI" Value="public:
[System::Runtime::CompilerServices::Extension]
 static void ExtractToFile(System::IO::Compression::ZipArchiveEntry ^ source, System::String ^ destinationFileName, bool overwrite);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.3.0</AssemblyVersion>
<AssemblyVersion>4.0.4.0</AssemblyVersion>
<AssemblyVersion>4.0.5.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.FileSystem</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchiveEntry" RefType="this" />
<Parameter Name="destinationFileName" Type="System.String" />
<Parameter Name="overwrite" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="source">The zip archive entry to extract a file from.</param>
<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>
<param name="overwrite">
<see langword="true" /> to overwrite an existing file that has the same name as the destination file; otherwise, <see langword="false" />.</param>
<summary>Extracts an entry in the zip archive to a file, and optionally overwrites an existing file that has the same name.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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.
You cannot use this method to extract a directory; use the <xref:System.IO.Compression.ZipFileExtensions.ExtractToDirectory%2A> method instead.
## Examples
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.
:::code language="csharp" source="~/snippets/csharp/System.IO.Compression/ZipArchive/Entries/program2.cs" id="Snippet2":::
:::code language="vb" source="~/snippets/visualbasic/System.IO.Compression/ZipArchive/Entries/program2.vb" id="Snippet2":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<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" />.
-or-
<paramref name="destinationFileName" /> specifies a directory.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationFileName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length. </exception>
<exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid (for example, it is on an unmapped drive).</exception>
<exception cref="T:System.IO.IOException">
<paramref name="destinationFileName" /> already exists and <paramref name="overwrite" /> is <see langword="false" />.
-or-
An I/O error occurred.
-or-
The entry is currently open for writing.
-or-
The entry has been deleted from the archive.</exception>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission to create the new file.</exception>
<exception cref="T:System.IO.InvalidDataException">The entry is missing from the archive or is corrupt and cannot be read.
-or-
The entry has been compressed by using a compression method that is not supported.</exception>
<exception cref="T:System.ObjectDisposedException">The zip archive that this entry belongs to has been disposed.</exception>
<exception cref="T:System.NotSupportedException">
<paramref name="destinationFileName" /> is in an invalid format.
-or-
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>
</Docs>
</Member>
<Member MemberName="ExtractToFileAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task ExtractToFileAsync (this System.IO.Compression.ZipArchiveEntry source, string destinationFileName, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task ExtractToFileAsync(class System.IO.Compression.ZipArchiveEntry source, string destinationFileName, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToFileAsync(System.IO.Compression.ZipArchiveEntry,System.String,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function ExtractToFileAsync (source As ZipArchiveEntry, destinationFileName As String, Optional cancellationToken As CancellationToken = Nothing) As Task" />
<MemberSignature Language="F#" Value="static member ExtractToFileAsync : System.IO.Compression.ZipArchiveEntry * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task" Usage="System.IO.Compression.ZipFileExtensions.ExtractToFileAsync (source, destinationFileName, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchiveEntry" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="destinationFileName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="cancellationToken" Type="System.Threading.CancellationToken" Index="2" FrameworkAlternate="net-10.0;net-11.0" />
</Parameters>
<Docs>
<param name="source">The zip archive entry to extract a file from.</param>
<param name="destinationFileName">
<para>The name of the file that will hold the contents of the entry.</para>
</param>
<param name="cancellationToken">The cancellation token to monitor for cancellation requests.</param>
<summary>Asynchronously creates a file on the file system with the entry's contents and the specified name.
</summary>
<returns>To be added.</returns>
<remarks>
<para>The specified path is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.</para>
<para>The last write time of the file is set to the entry's last write time. This method does not allow overwriting of an existing file with the same name. Attempting to extract explicit directories (entries with names that end in directory separator characters) will not result in the creation of a directory.</para>
</remarks>
<exception cref="T:System.UnauthorizedAccessException">The caller does not have the required permission.</exception>
<exception cref="T:System.ArgumentException">
<para>
<paramref name="destinationFileName" /> is a zero-length string, contains only whitespace, or contains one or more invalid characters as defined by InvalidPathChars.</para>
<para>-or-</para>
<para>
<paramref name="destinationFileName" /> specifies a directory.</para>
</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="destinationFileName" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.PathTooLongException">
<para>The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.</para>
</exception>
<exception cref="T:System.IO.DirectoryNotFoundException">
<para>The path specified in <paramref name="destinationFileName" /> is invalid (for example, it is on an unmapped drive).</para>
</exception>
<exception cref="T:System.IO.IOException">
<para>An I/O error has occurred.</para>
<para>-or-</para>
<para>The entry is currently open for writing.</para>
<para>-or-</para>
<para>The entry has been deleted from the archive.</para>
</exception>
<exception cref="T:System.NotSupportedException">
<para>
<paramref name="destinationFileName" /> is in an invalid format.</para>
<para>-or-</para>
<para>The ZipArchive that this entry belongs to was opened in a write-only mode.</para>
</exception>
<exception cref="T:System.IO.InvalidDataException">
<para>The entry is missing from the archive or is corrupt and cannot be read.</para>
<para>-or-</para>
<para>The entry has been compressed using a compression method that is not supported.</para>
</exception>
<exception cref="T:System.ObjectDisposedException">The ZipArchive that this entry belongs to has been disposed.</exception>
</Docs>
</Member>
<Member MemberName="ExtractToFileAsync">
<MemberSignature Language="C#" Value="public static System.Threading.Tasks.Task ExtractToFileAsync (this System.IO.Compression.ZipArchiveEntry source, string destinationFileName, bool overwrite, System.Threading.CancellationToken cancellationToken = default);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Threading.Tasks.Task ExtractToFileAsync(class System.IO.Compression.ZipArchiveEntry source, string destinationFileName, bool overwrite, valuetype System.Threading.CancellationToken cancellationToken) cil managed" />
<MemberSignature Language="DocId" Value="M:System.IO.Compression.ZipFileExtensions.ExtractToFileAsync(System.IO.Compression.ZipArchiveEntry,System.String,System.Boolean,System.Threading.CancellationToken)" />
<MemberSignature Language="VB.NET" Value="<Extension()>
Public Function ExtractToFileAsync (source As ZipArchiveEntry, destinationFileName As String, overwrite As Boolean, Optional cancellationToken As CancellationToken = Nothing) As Task" />
<MemberSignature Language="F#" Value="static member ExtractToFileAsync : System.IO.Compression.ZipArchiveEntry * string * bool * System.Threading.CancellationToken -> System.Threading.Tasks.Task" Usage="System.IO.Compression.ZipFileExtensions.ExtractToFileAsync (source, destinationFileName, overwrite, cancellationToken)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.IO.Compression.ZipFile</AssemblyName>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
<AssemblyVersion>11.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="source" Type="System.IO.Compression.ZipArchiveEntry" RefType="this" Index="0" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="destinationFileName" Type="System.String" Index="1" FrameworkAlternate="net-10.0;net-11.0" />
<Parameter Name="overwrite" Type="System.Boolean" Index="2" FrameworkAlternate="net-10.0;net-11.0" />