BufferedWebEventProvider.ProcessEvent(WebBaseEvent) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
處理傳遞給提供者的事件。
public:
override void ProcessEvent(System::Web::Management::WebBaseEvent ^ eventRaised);
public override void ProcessEvent (System.Web.Management.WebBaseEvent eventRaised);
override this.ProcessEvent : System.Web.Management.WebBaseEvent -> unit
Public Overrides Sub ProcessEvent (eventRaised As WebBaseEvent)
參數
- eventRaised
- WebBaseEvent
要處理的 WebBaseEvent 物件。
範例
下列程式碼範例將示範如何實作 ProcessEvent 方法。
// Processes the incoming events.
// This method performs custom processing and,
// if buffering is enabled, it calls the
// base.ProcessEvent to buffer the event
// information.
public override void ProcessEvent(
WebBaseEvent eventRaised)
{
if (UseBuffering)
{
// Buffering enabled, call the
// base event to buffer event information.
base.ProcessEvent(eventRaised);
}
else
{
// Buffering disabled, store the
// current event now.
customInfo.AppendLine(
"*** Buffering disabled ***");
customInfo.AppendLine(
eventRaised.ToString());
// Store the information in the specified file.
StoreToFile(customInfo,
logFilePath, FileMode.Append);
}
}
' Processes the incoming events.
' This method performs custom
' processing and, if buffering is
' enabled, it calls the base.ProcessEvent
' to buffer the event information.
Public Overrides Sub ProcessEvent( _
ByVal eventRaised As WebBaseEvent)
If UseBuffering Then
' Buffering enabled, call the base event to
' buffer event information.
MyBase.ProcessEvent(eventRaised)
Else
' Buffering disabled, store the current event
' now.
customInfo.AppendLine("*** Buffering disabled ***")
customInfo.AppendLine(eventRaised.ToString())
' Store the information in the specified file.
StoreToFile(customInfo, _
logFilePath, FileMode.Append)
End If
End Sub
備註
這是 ASP.NET 健全狀況監視呼叫以開始處理事件的方法。 如果已啟用緩衝處理,則會緩衝處理事件資訊;否則,它會分派至目前的記錄機制。