HealthMonitoringSection.EventMappings プロパティ
アセンブリ: System.Web (system.web.dll 内)

Dim instance As HealthMonitoringSection Dim value As EventMappingSettingsCollection value = instance.EventMappings
public: property EventMappingSettingsCollection^ EventMappings { EventMappingSettingsCollection^ get (); }
EventMappingSettings オブジェクトの EventMappingSettingsCollection コレクション。既定値は空の EventMappingSettingsCollection コレクションです。

EventMappings プロパティの使用方法のコード例を次に示します。このコード例は、HealthMonitoringSection クラスのトピックで取り上げているコード例の一部分です。
' Add a EventMappingsSettings object to the EventMappings collection property. Dim eventMappingSetting As EventMappingSettings = New EventMappingSettings( _ "Failure Audits", "System.Web.Management.WebAuditEvent, System.Web") eventMappingSetting.Name = "All Errors" eventMappingSetting.Type = _ "System.Web.Management.WebErrorEvent, System.Web" eventMappingSetting.StartEventCode = 0 eventMappingSetting.EndEventCode = 4096 healthMonitoringSection.EventMappings.Add(eventMappingSetting) ' 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( _ "Success Audits", "System.Web.Management.WebAuditEvent, System.Web", _ 512, Int32.MaxValue)) ' Insert an EventMappingsSettings object into the EventMappings collection property. healthMonitoringSection.EventMappings.Insert(1, _ new EventMappingSettings("HeartBeats", "", 1, 2)) ' Display contents of the EventMappings collection property Console.WriteLine( _ "EventMappings Collection contains {0} values:", healthMonitoringSection.EventMappings.Count) ' Display all elements. For i As System.Int32 = 0 To healthMonitoringSection.EventMappings.Count - 1 eventMappingSetting = healthMonitoringSection.EventMappings(i) Dim name As String = eventMappingSetting.Name Dim type As String = eventMappingSetting.Type Dim startCd As Integer = eventMappingSetting.StartEventCode Dim endCd As Integer = eventMappingSetting.EndEventCode Dim item As String = "Name='" & name & "', Type='" & type & _ "', StartEventCode = '" & startCd.ToString() & _ "', EndEventCode = '" & endCd.ToString() & "'" Console.WriteLine(" Item {0}: {1}", i, item) Next ' See if the EventMappings collection property contains the event 'HeartBeats'. Console.WriteLine("EventMappings contains 'HeartBeats': {0}.", _ healthMonitoringSection.EventMappings.Contains("HeartBeats")) ' Get the index of the 'HeartBeats' event in the EventMappings collection property. Console.WriteLine("EventMappings index for 'HeartBeats': {0}.", _ healthMonitoringSection.EventMappings.IndexOf("HeartBeats")) ' Get a named EventMappings eventMappingSetting = healthMonitoringSection.EventMappings("HeartBeats") ' Remove an EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.Remove("HeartBeats") ' Remove an EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.RemoveAt(0) ' Clear all EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.Clear()
// Add a EventMappingsSettings object to the EventMappings collection property. EventMappingSettings eventMappingSetting = new EventMappingSettings( "Failure Audits", "System.Web.Management.WebAuditEvent, System.Web"); eventMappingSetting.Name = "All Errors"; eventMappingSetting.Type = "System.Web.Management.WebErrorEvent, System.Web"; eventMappingSetting.StartEventCode = 0; eventMappingSetting.EndEventCode = 4096; healthMonitoringSection.EventMappings.Add(eventMappingSetting); // 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( "Success Audits", "System.Web.Management.WebAuditEvent, System.Web" , 512, Int32.MaxValue)); // Insert an EventMappingsSettings object into the EventMappings collection property. healthMonitoringSection.EventMappings.Insert(1, new EventMappingSettings("HeartBeats", "", 1, 2)); // Display contents of the EventMappings collection property Console.WriteLine( "EventMappings Collection contains {0} values:", healthMonitoringSection.EventMappings.Count); // Display all elements. for (System.Int32 i = 0; i < healthMonitoringSection.EventMappings.Count; i++) { eventMappingSetting = healthMonitoringSection.EventMappings[i]; string name = eventMappingSetting.Name; string type = eventMappingSetting.Type; int startCd = eventMappingSetting.StartEventCode; int endCd = eventMappingSetting.EndEventCode; string item = "Name='" + name + "', Type='" + type + "', StartEventCode = '" + startCd.ToString() + "', EndEventCode = '" + endCd.ToString() + "'"; Console.WriteLine(" Item {0}: {1}", i, item); } // See if the EventMappings collection property contains the event 'HeartBeats'. Console.WriteLine("EventMappings contains 'HeartBeats': {0}.", healthMonitoringSection.EventMappings.Contains("HeartBeats")); // Get the index of the 'HeartBeats' event in the EventMappings collection property. Console.WriteLine("EventMappings index for 'HeartBeats': {0}.", healthMonitoringSection.EventMappings.IndexOf("HeartBeats")); // Get a named EventMappings eventMappingSetting = healthMonitoringSection.EventMappings["HeartBeats"]; // Remove an EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.Remove("HeartBeats"); // Remove an EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.RemoveAt(0); // Clear all EventMappingsSettings object from the EventMappings collection property. healthMonitoringSection.EventMappings.Clear();

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からHealthMonitoringSection.EventMappings プロパティを検索する場合は、下記のリンクをクリックしてください。

- HealthMonitoringSection.EventMappings プロパティのページへのリンク