TraceSection.RequestLimit 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,表示 ASP.NET 儲存追蹤資訊的應用程式請求次數。
public:
property int RequestLimit { int get(); void set(int value); };
[System.Configuration.ConfigurationProperty("requestLimit", DefaultValue=10)]
[System.Configuration.IntegerValidator(MinValue=0)]
public int RequestLimit { get; set; }
[<System.Configuration.ConfigurationProperty("requestLimit", DefaultValue=10)>]
[<System.Configuration.IntegerValidator(MinValue=0)>]
member this.RequestLimit : int with get, set
Public Property RequestLimit As Integer
屬性值
伺服器上最多需儲存的請求數。 預設值為 10。
- 屬性
範例
以下程式碼範例說明如何使用該 RequestLimit 屬性。 此程式碼範例是本類別更大範例 TraceSection 的一部分。
// Get the current RequestLimit property value.
Int32 requestLimitValue = traceSection.RequestLimit;
// Set the RequestLimit property to 256.
traceSection.RequestLimit = 256;
' Get the current RequestLimit property value.
Dim requestLimitValue As Int32 = traceSection.RequestLimit
' Set the RequestLimit property to 256.
traceSection.RequestLimit = 256
備註
最高請求上限為 10,000 張。 若指定值大於10,000,則會靜默地向下取整為10,000 ASP.NET。
該 MostRecent 屬性會取得或設定一個值,用以判斷伺服器上儲存的請求是最新的請求還是最早抵達的請求。
註 當請求數超過此設定所設定的限制且 MostRecent 為 false時,追蹤日誌中不會再儲存更多請求。 若 MostRecent 為 true,則將最近的請求儲存在此設定所施加的限制範圍內,舊請求則被丟棄。