Skip to content
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Read>, the stream must support reading. If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Create>, the stream must support writing. If the `mode` parameter is set to <xref:System.IO.Compression.ZipArchiveMode.Update>, the stream must support reading, writing, and seeking.

When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names are decoded according to the following rules:
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names and comments are decoded according to the following rules:

- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name.
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name and comment.

- When the language encoding flag is set, UTF-8 is used to decode the entry name.
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.

When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names are decoded according to the following rules:
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names and comments are decoded according to the following rules:

- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name.
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name and comment.

- When the language encoding flag is set, UTF-8 is used to decode the entry name.
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.

When you write to archive files and `entryNameEncoding` is set to `null`, entry names are encoded according to the following rules:
When you write to archive files and `entryNameEncoding` is set to `null`, entry names and comments are encoded according to the following rules:

- For entry names that contain characters outside the ASCII range, the language encoding flag is set, and entry names are encoded by using UTF-8.
- For entry names and comments that contain characters outside the ASCII range, the language encoding flag is set, and entry names and comments are encoded by using UTF-8.

- For entry names that contain only ASCII characters, the language encoding flag is not set, and entry names are encoded by using the current system default code page.
- For entry names and comments that contain only ASCII characters, the language encoding flag is not set, and entry names and comments are encoded by using the current system default code page.

When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names and comments into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
20 changes: 10 additions & 10 deletions includes/remarks/System.IO.Compression/ZipFile/Open.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.

When you set the `mode` parameter to <xref:System.IO.Compression.ZipArchiveMode.Update>, the archive is opened with <xref:System.IO.FileMode.OpenOrCreate?displayProperty=nameWithType> as the file mode value. If the archive exists, it is opened. The existing entries can be modified and new entries can be created. If the archive does not exist, a new archive is created; however, creating a zip archive in <xref:System.IO.Compression.ZipArchiveMode.Update> mode is not as efficient as creating it in <xref:System.IO.Compression.ZipArchiveMode.Create> mode.

When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names are decoded according to the following rules:
When you open a zip archive file for reading and `entryNameEncoding` is set to `null`, entry names and comments are decoded according to the following rules:

- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name.
- When the language encoding flag (in the general-purpose bit flag of the local file header) is not set, the current system default code page is used to decode the entry name and comment.

- When the language encoding flag is set, UTF-8 is used to decode the entry name.
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.

When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names are decoded according to the following rules:
When you open a zip archive file for reading and `entryNameEncoding` is set to a value other than `null`, entry names and comments are decoded according to the following rules:

- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name.
- When the language encoding flag is not set, the specified `entryNameEncoding` is used to decode the entry name and comment.

- When the language encoding flag is set, UTF-8 is used to decode the entry name.
- When the language encoding flag is set, UTF-8 is used to decode the entry name and comment.

When you write to archive files and `entryNameEncoding` is set to `null`, entry names are encoded according to the following rules:
When you write to archive files and `entryNameEncoding` is set to `null`, entry names and comments are encoded according to the following rules:

- For entry names that contain characters outside the ASCII range, the language encoding flag is set, and entry names are encoded by using UTF-8.
- For entry names or comments that contain characters outside the ASCII range, the language encoding flag is set, and entry names and comments are encoded by using UTF-8.

- For entry names that contain only ASCII characters, the language encoding flag is not set, and entry names are encoded by using the current system default code page.
- For entry names or comments that contain only ASCII characters, the language encoding flag is not set, and entry names and comments are encoded by using the current system default code page.

When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
When you write to archive files and `entryNameEncoding` is set to a value other than `null`, the specified `entryNameEncoding` is used to encode the entry names and comments into bytes. The language encoding flag (in the general-purpose bit flag of the local file header) is set only when the specified encoding is a UTF-8 encoding.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@

class SafeHandlesExample
{

static void Main()
{
UnmanagedMutex uMutex = new UnmanagedMutex("YourCompanyName_SafeHandlesExample_MUTEX");

try
{

uMutex.Create();
Console.WriteLine("Mutex created. Press Enter to release it.");
Console.ReadLine();
Expand Down Expand Up @@ -58,10 +56,7 @@ public UnmanagedMutex(string Name)

public void Create()
{
if (nameValue == null && nameValue.Length == 0)
{
throw new ArgumentNullException("nameValue");
}
ArgumentException.ThrowIfNullOrEmpty(nameValue);

handleValue = CreateMutex(mutexAttrValue,
true, nameValue);
Expand Down Expand Up @@ -105,4 +100,4 @@ public void Release()
ReleaseMutex(handleValue);
}
}
//</Snippet1>
//</Snippet1>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// <Snippet1>
// <Snippet3>
using System;
using System.ComponentModel;
using System.IO;
Expand Down Expand Up @@ -49,14 +48,13 @@ static void Main()
startInfo.Verb = verbToUse;
if (verbToUse.ToLower().IndexOf("printto") >= 0)
{
// printto implies a specific printer. Ask for the network address.
// printto implies a specific printer. Ask for the network address.
// The address must be in the form \\server\printer.
// The printer address is passed as the Arguments property.
Console.Write("Enter the network address of the target printer: ");
var arguments = Console.ReadLine();
startInfo.Arguments = arguments;
}
// </Snippet4>

try
{
Expand All @@ -81,6 +79,7 @@ static void Main()
Console.WriteLine($"Unable to start '{fileName}' with verb {verbToUse}");
}
}
// </Snippet4>
}
else
{
Expand All @@ -90,5 +89,4 @@ static void Main()
}
}
}
// </Snippet3>
// </Snippet1>
2 changes: 1 addition & 1 deletion snippets/csharp/System/Object/GetType/GetTypeEx2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void Main()

// The example displays the following output:
// 12 is a 32-bit integer.
// 10653 is a 32-bit integer.
// 10653 is a 64-bit integer.
// 12 is an unsigned byte.
// -5 is a signed byte.
// 16.3 is a double-precision floating point.
Expand Down
6 changes: 0 additions & 6 deletions xml/FrameworksIndex/net-6.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12921,12 +12921,6 @@
</Namespace>
<Namespace Name="System.Collections.Generic">
<Type Name="System.Collections.Generic.CollectionExtensions" Id="T:System.Collections.Generic.CollectionExtensions">
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0,``1)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.Remove``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1@)" />
Expand Down
6 changes: 0 additions & 6 deletions xml/FrameworksIndex/net-7.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13725,12 +13725,6 @@
<Type Name="System.Collections.Generic.CollectionExtensions" Id="T:System.Collections.Generic.CollectionExtensions">
<Member Id="M:System.Collections.Generic.CollectionExtensions.AsReadOnly``1(System.Collections.Generic.IList{``0})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.AsReadOnly``2(System.Collections.Generic.IDictionary{``0,``1})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0,``1)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.Remove``2(System.Collections.Generic.IDictionary{``0,``1},``0,``1@)" />
Expand Down
6 changes: 0 additions & 6 deletions xml/FrameworksIndex/net-8.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15766,12 +15766,6 @@
<Member Id="M:System.Collections.Generic.CollectionExtensions.AsReadOnly``1(System.Collections.Generic.IList{``0})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.AsReadOnly``2(System.Collections.Generic.IDictionary{``0,``1})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.CopyTo``1(System.Collections.Generic.List{``0},System.Span{``0})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0,``1)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.InsertRange``1(System.Collections.Generic.List{``0},System.Int32,System.ReadOnlySpan{``0})" />
Expand Down
6 changes: 0 additions & 6 deletions xml/FrameworksIndex/net-9.0.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15993,12 +15993,6 @@
<Member Id="M:System.Collections.Generic.CollectionExtensions.CopyTo``1(System.Collections.Generic.List{``0},System.Span{``0})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetAlternateLookup``2(System.Collections.Generic.HashSet{``0})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetAlternateLookup``3(System.Collections.Generic.Dictionary{``0,``1})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetValueOrDefault``2(System.Collections.Generic.IReadOnlyDictionary{``0,``1},``0,``1)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.InsertRange``1(System.Collections.Generic.List{``0},System.Int32,System.ReadOnlySpan{``0})" />
Expand Down
8 changes: 0 additions & 8 deletions xml/FrameworksIndex/netframework-4.6.2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25520,14 +25520,6 @@
</Type>
</Namespace>
<Namespace Name="System.Collections.Generic">
<Type Name="System.Collections.Generic.CollectionExtensions" Id="T:System.Collections.Generic.CollectionExtensions">
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetDefaultRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup})" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeFileAssets(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
<Member Id="M:System.Collections.Generic.CollectionExtensions.GetRuntimeGroup(System.Collections.Generic.IEnumerable{Microsoft.Extensions.DependencyModel.RuntimeAssetGroup},System.String)" />
</Type>
<Type Name="System.Collections.Generic.Comparer`1" Id="T:System.Collections.Generic.Comparer`1">
<Member Id="M:System.Collections.Generic.Comparer`1.#ctor" />
<Member Id="M:System.Collections.Generic.Comparer`1.Compare(`0,`0)" />
Expand Down
Loading