WebViewStateFailureAuditEvent 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供網頁應用程式檢視狀態相關的故障資訊。
public ref class WebViewStateFailureAuditEvent : System::Web::Management::WebFailureAuditEvent
public class WebViewStateFailureAuditEvent : System.Web.Management.WebFailureAuditEvent
type WebViewStateFailureAuditEvent = class
inherit WebFailureAuditEvent
Public Class WebViewStateFailureAuditEvent
Inherits WebFailureAuditEvent
- 繼承
-
WebViewStateFailureAuditEvent
範例
以下是一段設定檔的節錄,展示如何設定 EventLogWebEventProvider 以捕捉視圖狀態失敗。 為了完整起見,我們展示了 和 provider 區段的eventMappings設置。 它們預設已經設定好了。 你唯一需要做的就是提供該區段的設置 rules 。
healthMonitoring如需詳細資訊,請參閱 。
要產生檢視狀態錯誤,請在您的瀏覽器中輸入一個帶有以下查詢字串的 URL:
?__VIEWSTATEFIELDCOUNT=1&__VIEWSTATE=bogus
如果你輸入以下設定,Windows 應用程式事件日誌會記錄一個視圖狀態失敗。
<healthMonitoring
enabled="true"
heartBeatInterval="0">
<providers>
// Configure the provider to process
// the health events.
<add name="EventLogProvider"
type="System.Web.Management.EventLogWebEventProvider,
System.Web,Version=2.0.3600.0,Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
<eventMappings>
<clear />
// Configure the WebFailureAuditEvent
// object to handle the Viewstate failures.
<add name="Failure Audits"
type="System.Web.Management.WebFailureAuditEvent,
System.Web,Version=2.0.3600.0,Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" />
</eventMappings>
<rules>
<clear/>
// Configure the connection between the
// application lifetime event object
// and the provider that must process it.
<add name="Viewstate Failure Events "
eventName="Failure Events"
provider="EventLogProvider"
profile="Default"
minInterval="00:01:00" />
</rules>
</healthMonitoring>
備註
ASP.NET 健康監控讓生產與營運人員能管理已部署的網頁應用程式。 System.Web.Management命名空間包含負責包裝應用程式健康狀態資料的健康事件類型,以及負責處理這些資料的提供者類型。 同時也包含協助健康事件管理的支援類型。
ASP.NET 在視圖狀態失效時會引發類型為 WebViewStateFailureAuditEvent 的事件。 此故障表示可能試圖篡改檢視狀態,或是從另一台使用不同金鑰的機器重複使用。 相關的稽核事件代碼為 AuditInvalidViewStateFailure。
Note
大多數情況下,你可以依實作使用 ASP.NET 健康監控類型,並且透過在 healthMonitoring 配置區塊指定數值來控制健康監控系統。 你也可以從健康監控類型中衍生,建立屬於自己的活動和服務提供者。
建構函式
| 名稱 | Description |
|---|---|
| WebViewStateFailureAuditEvent(String, Object, Int32, Int32, ViewStateException) |
使用所提供的參數初始化該類別的新實例 WebViewStateFailureAuditEvent 。 |
| WebViewStateFailureAuditEvent(String, Object, Int32, ViewStateException) |
使用提供的參數初始化類別 WebViewStateFailureAuditEvent 。 |
屬性
| 名稱 | Description |
|---|---|
| EventCode |
取得與事件相關的程式碼值。 (繼承來源 WebBaseEvent) |
| EventDetailCode |
取得事件細節代碼。 (繼承來源 WebBaseEvent) |
| EventID |
取得與事件相關的識別碼。 (繼承來源 WebBaseEvent) |
| EventOccurrence |
會獲得一個代表事件發生次數的計數器。 (繼承來源 WebBaseEvent) |
| EventSequence |
讀取該事件被應用程式提出的次數。 (繼承來源 WebBaseEvent) |
| EventSource |
獲得能引發事件的物件。 (繼承來源 WebBaseEvent) |
| EventTime |
取得事件被提出的時間。 (繼承來源 WebBaseEvent) |
| EventTimeUtc |
取得事件被提出的時間。 (繼承來源 WebBaseEvent) |
| Message |
收到描述事件的訊息。 (繼承來源 WebBaseEvent) |
| ProcessInformation |
取得有關 ASP.NET 應用程式託管流程的資訊。 (繼承來源 WebManagementEvent) |
| RequestInformation |
取得與網路請求相關的資訊。 (繼承來源 WebAuditEvent) |
| ViewStateException |
會獲得因故障而產生的例外。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| FormatCustomEventDetails(WebEventFormatter) |
提供活動資訊的標準格式。 (繼承來源 WebBaseEvent) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| IncrementPerfCounters() |
增加審計失敗事件提升績效計數。 (繼承來源 WebFailureAuditEvent) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| Raise() |
透過通知任何已設定的提供者事件已發生,從而提出事件。 (繼承來源 WebBaseEvent) |
| ToString() |
格式化活動資訊以供展示用途。 (繼承來源 WebBaseEvent) |
| ToString(Boolean, Boolean) |
格式化活動資訊以供展示用途。 (繼承來源 WebBaseEvent) |