WebHeaderCollection 建構函式

定義

初始化 WebHeaderCollection 類別的新執行個體。

多載

WebHeaderCollection()

初始化 WebHeaderCollection 類別的新執行個體。

WebHeaderCollection(SerializationInfo, StreamingContext)
已淘汰.

初始化 WebHeaderCollection 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。

WebHeaderCollection()

來源:
WebHeaderCollection.cs
來源:
WebHeaderCollection.cs
來源:
WebHeaderCollection.cs

初始化 WebHeaderCollection 類別的新執行個體。

public:
 WebHeaderCollection();
public WebHeaderCollection ();
Public Sub New ()

適用於

WebHeaderCollection(SerializationInfo, StreamingContext)

來源:
WebHeaderCollection.cs
來源:
WebHeaderCollection.cs
來源:
WebHeaderCollection.cs

警告

This API supports obsolete formatter-based serialization. It should not be called or extended by application code.

初始化 WebHeaderCollection 類別的新執行個體,這個執行個體是來自 SerializationInfoStreamingContext 類別的指定執行個體。

protected:
 WebHeaderCollection(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);
protected WebHeaderCollection (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 WebHeaderCollection (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);
new System.Net.WebHeaderCollection : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebHeaderCollection
[<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.WebHeaderCollection : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Net.WebHeaderCollection
Protected Sub New (serializationInfo As SerializationInfo, streamingContext As StreamingContext)

參數

serializationInfo
SerializationInfo

SerializationInfo,含有要序列化 WebHeaderCollection 的必要資訊。

streamingContext
StreamingContext

StreamingContext,含有與新 WebHeaderCollection 關聯之已序列化資料流的來源。

屬性

例外狀況

headerName 包含無效的字元。

headerName 為 Null 參考或 Empty

備註

這個建構函式會 ISerializable 實作 類別的 WebHeaderCollection 介面。

另請參閱

適用於