共用方式為


WebEventProvider.ProcessEvent(WebBaseEvent) 方法

定義

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

public:
 abstract void ProcessEvent(System::Web::Management::WebBaseEvent ^ raisedEvent);
public abstract void ProcessEvent (System.Web.Management.WebBaseEvent raisedEvent);
abstract member ProcessEvent : System.Web.Management.WebBaseEvent -> unit
Public MustOverride Sub ProcessEvent (raisedEvent As WebBaseEvent)

參數

raisedEvent
WebBaseEvent

要處理的 WebBaseEvent 物件。

範例

下列程式碼範例將示範如何實作 ProcessEvent 方法。 這個方法會將事件的自訂字串表示附加至特定的記錄檔。


// Process the event that has been raised.
public override void ProcessEvent(WebBaseEvent raisedEvent)
{ 
    if (msgCounter < maxMsgNumber)
    {
        // Buffer the event information.
        msgBuffer.Enqueue(raisedEvent);
        // Increment the message counter.
        msgCounter += 1;
    }
    else
    {
        // Flush the buffer.
        Flush();
    }
}
' Process the event that has been raised.
Public Overrides Sub ProcessEvent( _
ByVal raisedEvent As WebBaseEvent)

    If msgCounter < maxMsgNumber Then
        ' Buffer the event information.
        msgBuffer.Enqueue(raisedEvent)
        ' Increment the message counter.
        msgCounter += 1
    Else
        ' Flush the buffer.
        Flush()
    End If

End Sub

備註

這是 ASP.NET 健康情況監視呼叫以開始處理事件的方法。

適用於