NetworkInformationException Constructors

Definition

Initializes a new instance of the NetworkInformationException class.

Overloads

NetworkInformationException()

Initializes a new instance of the NetworkInformationException class.

NetworkInformationException(Int32)

Initializes a new instance of the NetworkInformationException class with the specified error code.

NetworkInformationException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the NetworkInformationException class with serialized data.

NetworkInformationException()

Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs

Initializes a new instance of the NetworkInformationException class.

C#
public NetworkInformationException();

Remarks

This constructor sets the ErrorCode property to the most recent Win32 error.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

NetworkInformationException(Int32)

Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs

Initializes a new instance of the NetworkInformationException class with the specified error code.

C#
public NetworkInformationException(int errorCode);

Parameters

errorCode
Int32

A Win32 error code.

Remarks

This constructor sets the value of the ErrorCode property to errorCode.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

NetworkInformationException(SerializationInfo, StreamingContext)

Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs
Source:
NetworkInformationException.cs

Caution

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

Initializes a new instance of the NetworkInformationException class with serialized data.

C#
[System.Obsolete("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected NetworkInformationException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
C#
protected NetworkInformationException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);

Parameters

serializationInfo
SerializationInfo

A SerializationInfo object that contains the serialized exception data.

streamingContext
StreamingContext

A StreamingContext that contains contextual information about the serialized exception.

Attributes

Remarks

This constructor is used by the system to create a NetworkInformationException instance from serialized data.

Applies to

.NET 10 ja muud versioonid
Toode Versioonid (aegunud)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7 (8, 9, 10)
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1