語言

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構子。

適用於