InstrumentationType 列挙体
アセンブリ: System.Management (system.management.dll 内)

Public Enumeration InstrumentationType

メンバ名 | 説明 | |
---|---|---|
Abstract | このクラスは、管理インストルメンテーションの抽象クラスを定義します。 | |
Event | このクラスは、管理インストルメンテーションのイベントを提供します。 | |
Instance | このクラスは、管理インストルメンテーションのインスタンスを提供します。 |

次の例は、InstrumentationType 列挙体を使用して管理イベント クラスを作成する方法を示しています。
Imports System Imports System.Management Imports System.Configuration.Install Imports System.Management.Instrumentation ' This sample demonstrates how to create ' a management event class by using ' the InstrumentationType enumeration ' Specify which namespace the management event ' class is created in <Assembly: Instrumented("Root/Default")> ' Let the system know InstallUtil.exe tool will ' be run against this assembly <System.ComponentModel.RunInstaller(True)> _ Public Class MyInstaller Inherits DefaultManagementProjectInstaller End Class 'MyInstaller Namespace WMISample ' Create a management instrumentation event class <InstrumentationClass(InstrumentationType.Event)> _ Public Class MyEvent Private EventName As String Function setEventName(ByVal name As String) EventName = name End Function End Class Public Class SampleEventProvider Public Shared Function Main(ByVal args() _ As String) As Integer Dim e As New MyEvent e.setEventName("Hello") ' Fire a management event System.Management.Instrumentation. _ Instrumentation.Fire(e) Return 0 End Function End Class End Namespace
using System; using System.Management; using System.Configuration.Install; using System.Management.Instrumentation; // This example demonstrates how to create // a management event class by using // the InstrumentationType enumeration // Specify which namespace the management event // class is created in [assembly:Instrumented("Root/Default")] // Let the system know you will run // InstallUtil.exe tool against this assembly [System.ComponentModel.RunInstaller(true)] public class MyInstaller : DefaultManagementProjectInstaller {} namespace WMISample { // Create a management instrumentation event class [InstrumentationClass(InstrumentationType.Event)] public class MyEvent { private string EventName; public void setEventName(string name) { EventName = name; } } public class WMIInstrumentedEventExample { public static void Main() { MyEvent e = new MyEvent(); e.setEventName("Hello"); // Fire a management event Instrumentation.Fire(e); return; } } }

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


- InstrumentationType 列挙体のページへのリンク