WebHeaderCollection.Item[String] 屬性

定義

取得或設定指定的標頭。Gets or sets the specified header.

多載

Item[HttpRequestHeader]

取得或設定指定的要求標頭。Gets or sets the specified request header.

Item[HttpResponseHeader]

取得或設定指定的回應標頭。Gets or sets the specified response header.

Item[String]

Item[HttpRequestHeader]

取得或設定指定的要求標頭。Gets or sets the specified request header.

public:
 property System::String ^ default[System::Net::HttpRequestHeader] { System::String ^ get(System::Net::HttpRequestHeader header); void set(System::Net::HttpRequestHeader header, System::String ^ value); };
public string this[System.Net.HttpRequestHeader header] { get; set; }
member this.Item(System.Net.HttpRequestHeader) : string with get, set
Default Public Property Item(header As HttpRequestHeader) As String

參數

header
HttpRequestHeader

要求標頭值。The request header value.

屬性值

String 執行個體,含有指定的標頭值。A String instance containing the specified header value.

例外狀況

這個 WebHeaderCollection 執行個體不允許 HttpRequestHeader 的執行個體。This WebHeaderCollection instance does not allow instances of HttpRequestHeader.

Item[HttpResponseHeader]

取得或設定指定的回應標頭。Gets or sets the specified response header.

public:
 property System::String ^ default[System::Net::HttpResponseHeader] { System::String ^ get(System::Net::HttpResponseHeader header); void set(System::Net::HttpResponseHeader header, System::String ^ value); };
public string this[System.Net.HttpResponseHeader header] { get; set; }
member this.Item(System.Net.HttpResponseHeader) : string with get, set
Default Public Property Item(header As HttpResponseHeader) As String

參數

header
HttpResponseHeader

回應標頭值。The response header value.

屬性值

String 執行個體,含有指定的標頭。A String instance containing the specified header.

例外狀況

value 的長度大於 65535。The length of value is greater than 65535.

這個 WebHeaderCollection 執行個體不允許 HttpResponseHeader 的執行個體。This WebHeaderCollection instance does not allow instances of HttpResponseHeader.

Item[String]

public:
 property System::String ^ default[System::String ^] { System::String ^ get(System::String ^ name); void set(System::String ^ name, System::String ^ value); };
public string this[string name] { get; set; }
member this.Item(string) : string with get, set
Default Public Property Item(name As String) As String

參數

name
String

屬性值

適用於