HttpRequestHeaderCollection.MaxForwards 屬性

定義

取得或設定整數值,表示 HTTP 要求上 Max-Forwards HTTP 標頭的值。

public:
 property IReference<unsigned int> ^ MaxForwards { IReference<unsigned int> ^ get(); void set(IReference<unsigned int> ^ value); };
IReference<uint32_t> MaxForwards();

void MaxForwards(IReference<uint32_t> value);
public System.Nullable<uint> MaxForwards { get; set; }
var iReference = httpRequestHeaderCollection.maxForwards;
httpRequestHeaderCollection.maxForwards = iReference;
Public Property MaxForwards As Nullable(Of UInteger)

屬性值

IReference<UInt32>

Nullable<UInt32>

Windows.Foundation.IReference

IReference<uint32_t>

整數值,表示 HTTP 要求上 Max-Forwards HTTP 標頭的值。 Null 值表示標頭不存在。

備註

下列範例程式碼示範使用HttpRequestHeaderCollection物件上的 MaxForwards 屬性,在HttpRequestMessage物件上設定Max-Forwards標頭的方法。

public void DemonstrateHeaderRequestMaxForwards() {
    var request = new HttpRequestMessage();

    // Set the header with an integer.
    request.Headers.MaxForwards= 2;

    // Get the strong type out
    System.Diagnostics.Debug.WriteLine("MaxForwards value: {0}", request.Headers.MaxForwards);
}

適用於

另請參閱