NetworkInformationException Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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()
Initializes a new instance of the NetworkInformationException class.
public:
NetworkInformationException();
public NetworkInformationException ();
Public Sub New ()
Remarks
This constructor sets the ErrorCode property to the most recent Win32
error.
Applies to
NetworkInformationException(Int32)
Initializes a new instance of the NetworkInformationException class with the specified error code.
public:
NetworkInformationException(int errorCode);
public NetworkInformationException (int errorCode);
new System.Net.NetworkInformation.NetworkInformationException : int -> System.Net.NetworkInformation.NetworkInformationException
Public Sub New (errorCode As Integer)
Parameters
- errorCode
- Int32
A Win32
error code.
Remarks
This constructor sets the value of the ErrorCode property to errorCode
.
Applies to
NetworkInformationException(SerializationInfo, StreamingContext)
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.
protected:
NetworkInformationException(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected NetworkInformationException (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[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);
new System.Net.NetworkInformation.NetworkInformationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.NetworkInformation.NetworkInformationException
[<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}")>]
new System.Net.NetworkInformation.NetworkInformationException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.NetworkInformation.NetworkInformationException
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As 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.