HttpWebRequest 建構函式

定義

初始化 HttpWebRequest 類別的新執行個體。 這些建構函式已過時;如需詳細資料,請參閱<備註>一節。

多載

HttpWebRequest()
已淘汰.
已淘汰.

初始化 HttpWebRequest 類別的新執行個體。 此建構函式已經過時。

HttpWebRequest(SerializationInfo, StreamingContext)
已淘汰.
已淘汰.
已淘汰.
已淘汰.

初始化 HttpWebRequest 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。 此建構函式已經過時。

備註

這兩個 HttpWebRequest 建構函式都已過時,不應使用。 WebRequest.CreateHttp呼叫 方法以初始化新的 HttpWebRequest 物件。

HttpWebRequest()

警告

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

警告

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

初始化 HttpWebRequest 類別的新執行個體。 此建構函式已經過時。

public:
 HttpWebRequest();
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public HttpWebRequest ();
[System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)]
public HttpWebRequest ();
Public Sub New ()
屬性

適用於

HttpWebRequest(SerializationInfo, StreamingContext)

來源:
HttpWebRequest.cs
來源:
HttpWebRequest.cs
來源:
HttpWebRequest.cs

警告

Serialization is obsoleted for this type. https://go.microsoft.com/fwlink/?linkid=14202

警告

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead

警告

WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.

警告

Serialization is obsoleted for this type. http://go.microsoft.com/fwlink/?linkid=14202

初始化 HttpWebRequest 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。 此建構函式已經過時。

protected:
 HttpWebRequest(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[System.Obsolete("Serialization is obsoleted for this type.  http://go.microsoft.com/fwlink/?linkid=14202")]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
[<System.Obsolete("Serialization is obsoleted for this type.  https://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("WebRequest, HttpWebRequest, ServicePoint, and WebClient are obsolete. Use HttpClient instead.", DiagnosticId="SYSLIB0014", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
[<System.Obsolete("Serialization is obsoleted for this type.  http://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.HttpWebRequest
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

參數

serializationInfo
SerializationInfo

SerializationInfo 物件,包含序列化新的 HttpWebRequest 物件所需的資訊。

streamingContext
StreamingContext

StreamingContext 物件,包含與新 HttpWebRequest 物件關聯的序列化資料流的來源和目的端。

屬性

備註

使用序列化時,應用程式必須以完全信任模式執行。

另請參閱

適用於