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 运行状况监视调用以启动事件处理的方法。 如果启用了缓冲,则会缓冲事件信息;否则,它会调度到当前日志记录机制。