共用方式為


BufferedWebEventProvider.ProcessEvent(WebBaseEvent) 方法

定義

處理傳遞給提供者的事件。

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 健全狀況監視呼叫以開始處理事件的方法。 如果已啟用緩衝處理,則會緩衝處理事件資訊;否則,它會分派至目前的記錄機制。

適用於