EventMappingSettings 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 EventMappingSettings 類別的新執行個體。
多載
| 名稱 | Description |
|---|---|
| EventMappingSettings(String, String) |
使用指定的名稱和類型初始化該類別的新實例 EventMappingSettings 。 |
| EventMappingSettings(String, String, Int32, Int32) |
使用指定的值初始化該類別的新實例 BufferModeSettings 。 |
EventMappingSettings(String, String)
使用指定的名稱和類型初始化該類別的新實例 EventMappingSettings 。
public:
EventMappingSettings(System::String ^ name, System::String ^ type);
public EventMappingSettings(string name, string type);
new System.Web.Configuration.EventMappingSettings : string * string -> System.Web.Configuration.EventMappingSettings
Public Sub New (name As String, type As String)
參數
- name
- String
被創造的物件名稱 EventMappingSettings 。
- type
- String
使用完全合格的活動類別類型。
範例
以下程式碼範例展示了如何使用 EventMappingSettings 建構子。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。
// Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings(
"Failure Audits", "System.Web.Management.WebAuditEvent, System.Web"));
' Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings( _
"Failure Audits", "System.Web.Management.WebAuditEvent, System.Web"))
備註
下表顯示此建構子所使用的預設設定。
| Setting | 預設值 |
|---|---|
| StartEventCode | 0. |
| EndEventCode | MaxValue。 |
另請參閱
適用於
EventMappingSettings(String, String, Int32, Int32)
使用指定的值初始化該類別的新實例 BufferModeSettings 。
public:
EventMappingSettings(System::String ^ name, System::String ^ type, int startEventCode, int endEventCode);
public EventMappingSettings(string name, string type, int startEventCode, int endEventCode);
new System.Web.Configuration.EventMappingSettings : string * string * int * int -> System.Web.Configuration.EventMappingSettings
Public Sub New (name As String, type As String, startEventCode As Integer, endEventCode As Integer)
參數
- name
- String
被創造的物件名稱 EventMappingSettings 。
- type
- String
使用完全合格的活動類別類型。
- startEventCode
- Int32
起始事件代碼範圍。
- endEventCode
- Int32
結局事件代碼範圍。
範例
以下程式碼範例展示了如何使用 EventMappingSettings 建構子。 此程式碼範例是本類別更大範例 HealthMonitoringSection 的一部分。
// Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings(
"Success Audits", "System.Web.Management.WebAuditEvent, System.Web",
512, Int32.MaxValue));
' Add an EventMappingsSettings object to the EventMappings collection property.
healthMonitoringSection.EventMappings.Add(new EventMappingSettings( _
"Success Audits", "System.Web.Management.WebAuditEvent, System.Web", _
512, Int32.MaxValue))