HttpWebRequest 建構函式

定義

初始化 HttpWebRequest 類別的新執行個體。Initializes a new instance of the HttpWebRequest class. 這些建構函式已過時;如需詳細資料,請參閱<備註>一節。These constructors are obsolete; see the Remarks section for details.

多載

HttpWebRequest()
已過時。
已過時。

初始化 HttpWebRequest 類別的新執行個體。Initializes a new instance of the HttpWebRequest class. 此建構函式已經過時。This constructor is obsolete.

HttpWebRequest(Uri)
HttpWebRequest(SerializationInfo, StreamingContext)
已過時。
已過時。
已過時。

初始化 HttpWebRequest 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。Initializes a new instance of the HttpWebRequest class from the specified instances of the SerializationInfo and StreamingContext classes. 此建構函式已經過時。This constructor is obsolete.

備註

這兩個函式 HttpWebRequest 都已過時,不應使用。Both HttpWebRequest constructors are obsolete and should not be used. 呼叫 WebRequest.CreateHttp 方法來初始化新 HttpWebRequest 的物件。Call the WebRequest.CreateHttp method to initialize new HttpWebRequest objects.

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 類別的新執行個體。Initializes a new instance of the HttpWebRequest class. 此建構函式已經過時。This constructor is obsolete.

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 ();
Public Sub New ()
屬性

適用於

HttpWebRequest(Uri)

public:
 HttpWebRequest(Uri ^ uri);
public HttpWebRequest (Uri uri);
new System.Net.HttpWebRequest : Uri -> System.Net.HttpWebRequest
Public Sub New (uri As Uri)

參數

uri
Uri

適用於

HttpWebRequest(SerializationInfo, StreamingContext)

警告

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

警告

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

警告

Serialization is obsoleted for this type

初始化 HttpWebRequest 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。Initializes a new instance of the HttpWebRequest class from the specified instances of the SerializationInfo and StreamingContext classes. 此建構函式已經過時。This constructor is obsolete.

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.  http://go.microsoft.com/fwlink/?linkid=14202")]
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("Serialization is obsoleted for this type", false)]
protected HttpWebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
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
[<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("Serialization is obsoleted for this type", false)>]
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 物件所需的資訊。A SerializationInfo object that contains the information required to serialize the new HttpWebRequest object.

streamingContext
StreamingContext

StreamingContext 物件,包含與新 HttpWebRequest 物件關聯的序列化資料流的來源和目的端。A StreamingContext object that contains the source and destination of the serialized stream associated with the new HttpWebRequest object.

屬性

備註

使用序列化時,應用程式必須在完全信任模式下執行。An application must run in full trust mode when using serialization.

另請參閱

適用於