WebResponse 构造函数
定义
初始化 WebResponse 类的新实例。Initializes a new instance of the WebResponse class.
重载
| WebResponse() |
初始化 WebResponse 类的新实例。Initializes a new instance of the WebResponse class. |
| WebResponse(SerializationInfo, StreamingContext) |
从 WebResponse 和 SerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。Initializes a new instance of the WebResponse class from the specified instances of the SerializationInfo and StreamingContext classes. |
WebResponse()
初始化 WebResponse 类的新实例。Initializes a new instance of the WebResponse class.
protected:
WebResponse();
protected WebResponse ();
Protected Sub New ()
注解
应用程序不直接调用 WebResponse 构造函数; 请 GetResponse 对实例使用方法 WebRequest 。Applications do not call the WebResponse constructor directly; use the GetResponse method on a WebRequest instance.
继承者说明
此构造函数创建并初始化子代类的必填字段。This constructor creates and initializes the required fields for descendant classes.
适用于
WebResponse(SerializationInfo, StreamingContext)
从 WebResponse 和 SerializationInfo 类的指定实例初始化 StreamingContext 类的新实例。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);
new System.Net.WebResponse : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebResponse
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)
参数
- serializationInfo
- SerializationInfo
SerializationInfo 类的实例,包含序列化新 WebRequest 实例所需的信息。An instance of the SerializationInfo class that contains the information required to serialize the new WebRequest instance.
- streamingContext
- StreamingContext
StreamingContext 类的实例,指示与新的 WebRequest 实例关联的序列化流的源。An instance of the StreamingContext class that indicates the source of the serialized stream that is associated with the new WebRequest instance.
例外
当未在子类中重写该构造函数时,尝试访问该构造函数。Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class.
注解
当由子类实现时,此构造函数实现 ISerializable 子代的接口 WebResponse 。When implemented by a descendant class, this constructor implements the ISerializable interface for the WebResponse descendant.