Bewerken

Share via


WebResponse Constructors

Definition

Initializes a new instance of the WebResponse class.

Overloads

WebResponse()

Initializes a new instance of the WebResponse class.

WebResponse(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the WebResponse class from the specified instances of the SerializationInfo and StreamingContext classes.

WebResponse()

Source:
WebResponse.cs
Source:
WebResponse.cs
Source:
WebResponse.cs

Initializes a new instance of the WebResponse class.

protected:
 WebResponse();
protected WebResponse ();
Protected Sub New ()

Remarks

Applications do not call the WebResponse constructor directly; use the GetResponse method on a WebRequest instance.

Notes to Inheritors

This constructor creates and initializes the required fields for descendant classes.

Applies to

WebResponse(SerializationInfo, StreamingContext)

Source:
WebResponse.cs
Source:
WebResponse.cs
Source:
WebResponse.cs

Caution

Serialization has been deprecated for WebResponse.

Initializes a new instance of the WebResponse class from the specified instances of the SerializationInfo and StreamingContext classes.

protected:
 WebResponse(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected WebResponse (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("Serialization has been deprecated for WebResponse.")]
protected WebResponse (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.WebResponse : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebResponse
[<System.Obsolete("Serialization has been deprecated for WebResponse.")>]
new System.Net.WebResponse : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebResponse
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

Parameters

serializationInfo
SerializationInfo

An instance of the SerializationInfo class that contains the information required to serialize the new WebRequest instance.

streamingContext
StreamingContext

An instance of the StreamingContext class that indicates the source of the serialized stream that is associated with the new WebRequest instance.

Attributes

Exceptions

Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class.

Remarks

When implemented by a descendant class, this constructor implements the ISerializable interface for the WebResponse descendant.

Applies to