WebEventProvider 构造函数

定义

初始化 WebEventProvider 类的新实例。

protected:
 WebEventProvider();
protected WebEventProvider ();
Protected Sub New ()

示例

下面的代码示例演示如何在自定义事件提供程序中使用此构造函数。

// Initializes the provider.
public SampleEventProvider(): base()
{

    // Initialize the local path of the file 
    // that holds event information.
    logFilePath = "C:/test/log.doc";

    // Clear the message buffer.
    msgBuffer.Clear();

    // Initialize the max number of messages
    // to buffer.
    maxMsgNumber = 10;

    // More custom initialization goes here.
}
' Initializes the provider.
Public Sub New() 
    
    ' Initialize the local path of the file 
    ' that holds event information.
    logFilePath = "C:/test/log.doc"
    
    ' Clear the message buffer.
    msgBuffer.Clear()
    
    ' Initialize the max number of messages
    ' to buffer.
    maxMsgNumber = 10

End Sub
 
' More custom initialization goes here.

注解

构造 WebEventProvider 函数不打算在代码中直接使用。 它由 ASP.NET 调用。 从 类派生WebEventProvider时,可以调用 WebEventProvider 构造函数。

适用于