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 建構函式。

適用於