WqlEventQuery クラス
アセンブリ: System.Management (system.management.dll 内)

Public Class WqlEventQuery Inherits EventQuery
public class WqlEventQuery : EventQuery
public class WqlEventQuery extends EventQuery
public class WqlEventQuery extends EventQuery

System.Management.ManagementQuery
System.Management.EventQuery
System.Management.WqlEventQuery


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ ()
アセンブリ: System.Management (system.management.dll 内)



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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, String, TimeSpan, String[])
アセンブリ: System.Management (system.management.dll 内)

Public Sub New ( _ eventClassName As String, _ condition As String, _ groupWithinInterval As TimeSpan, _ groupByPropertyList As String() _ )
Dim eventClassName As String Dim condition As String Dim groupWithinInterval As TimeSpan Dim groupByPropertyList As String() Dim instance As New WqlEventQuery(eventClassName, condition, groupWithinInterval, groupByPropertyList)
public WqlEventQuery ( string eventClassName, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList )
public: WqlEventQuery ( String^ eventClassName, String^ condition, TimeSpan groupWithinInterval, array<String^>^ groupByPropertyList )
public WqlEventQuery ( String eventClassName, String condition, TimeSpan groupWithinInterval, String[] groupByPropertyList )
public function WqlEventQuery ( eventClassName : String, condition : String, groupWithinInterval : TimeSpan, groupByPropertyList : String[] )


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, TimeSpan, String)
アセンブリ: System.Management (system.management.dll 内)

Public Sub New ( _ eventClassName As String, _ withinInterval As TimeSpan, _ condition As String _ )
Dim eventClassName As String Dim withinInterval As TimeSpan Dim condition As String Dim instance As New WqlEventQuery(eventClassName, withinInterval, condition)
public function WqlEventQuery ( eventClassName : String, withinInterval : TimeSpan, condition : String )

次の例では、イベント クエリ "SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA Win32_Service" を作成します。これは、10 秒のポーリング間隔で、Win32_Service インスタンスの作成通知を送信します。
Imports System Imports System.Management Public Class EventSample Public Overloads Shared Function _ Main(ByVal args() As String) As Integer ' Requests notification of the creation ' of Win32_Service instances with a 10 second ' allowed latency. Dim t As New TimeSpan(0, 0, 10) Dim q As New WqlEventQuery("__InstanceCreationEvent", _ t, "TargetInstance isa ""Win32_Service""") MessageBox.Show(q.QueryString) End Function 'Main End Class 'EventSample
using System; using System.Management; public class EventSample { public static void Main(string[] args) { // Requests notification of the creation // of Win32_Service instances with // a 10 second allowed latency. WqlEventQuery q = new WqlEventQuery("__InstanceCreationEvent", new TimeSpan(0,0,10), "TargetInstance isa 'Win32_Service'"); Console.WriteLine(q.QueryString); 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, TimeSpan, String, TimeSpan, String[], String)
アセンブリ: System.Management (system.management.dll 内)

Public Sub New ( _ eventClassName As String, _ withinInterval As TimeSpan, _ condition As String, _ groupWithinInterval As TimeSpan, _ groupByPropertyList As String(), _ havingCondition As String _ )
Dim eventClassName As String Dim withinInterval As TimeSpan Dim condition As String Dim groupWithinInterval As TimeSpan Dim groupByPropertyList As String() Dim havingCondition As String Dim instance As New WqlEventQuery(eventClassName, withinInterval, condition, groupWithinInterval, groupByPropertyList, havingCondition)
public WqlEventQuery ( string eventClassName, TimeSpan withinInterval, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList, string havingCondition )
public: WqlEventQuery ( String^ eventClassName, TimeSpan withinInterval, String^ condition, TimeSpan groupWithinInterval, array<String^>^ groupByPropertyList, String^ havingCondition )
public WqlEventQuery ( String eventClassName, TimeSpan withinInterval, String condition, TimeSpan groupWithinInterval, String[] groupByPropertyList, String havingCondition )
public function WqlEventQuery ( eventClassName : String, withinInterval : TimeSpan, condition : String, groupWithinInterval : TimeSpan, groupByPropertyList : String[], havingCondition : String )

次の例では、イベント クエリ "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA Win32_NTLogEvent GROUP WITHIN 600 BY TargetInstance.SourceName HAVING NumberOfEvents > 15" を作成します。これは、同じソースから受け取った Win32_NTLogEvent イベントの数が 15 を超えた場合にだけ、集約イベントを配信します。
Imports System Imports System.Management Public Class EventSample Public Overloads Shared Function _ Main(ByVal args() As String) As Integer ' Requests sending aggregated events ' if the number of events exceeds 15. Dim props() As String = {"TargetInstance.SourceName"} Dim t As New TimeSpan(0, 10, 0) Dim q As New WqlEventQuery("__InstanceCreationEvent", _ System.TimeSpan.MaxValue, _ "TargetInstance isa ""Win32_NTLogEvent""", _ t, _ props, _ "NumberOfEvents >15") MessageBox.Show(q.QueryString) End Function 'Main End Class 'EventSample
using System; using System.Management; public class EventSample { public static void Main(string[] args) { // Requests sending aggregated events // if the number of events exceeds 15. String[] props = {"TargetInstance.SourceName"}; WqlEventQuery q = new WqlEventQuery( "__InstanceCreationEvent", System.TimeSpan.MaxValue, "TargetInstance isa 'Win32_NTLogEvent'", new TimeSpan(0,10,0), props, "NumberOfEvents >15"); Console.WriteLine(q.QueryString); 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, String, TimeSpan)
アセンブリ: System.Management (system.management.dll 内)

Public Sub New ( _ eventClassName As String, _ condition As String, _ groupWithinInterval As TimeSpan _ )
Dim eventClassName As String Dim condition As String Dim groupWithinInterval As TimeSpan Dim instance As New WqlEventQuery(eventClassName, condition, groupWithinInterval)
public function WqlEventQuery ( eventClassName : String, condition : String, groupWithinInterval : TimeSpan )


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String)
アセンブリ: System.Management (system.management.dll 内)


クエリを指定して WqlEventQuery を初期化してから、イベントを指定して WqlEventQuery を初期化する例を次に示します。
Imports System Imports System.Management Public Class EventSample Public Overloads Shared Function _ Main(ByVal args() As String) As Integer '' Full query string specified to the constructor Dim q As New WqlEventQuery( _ "SELECT * FROM Win32_ComputerShutdownEvent ") ' Only relevant event class name specified to the constructor ' Results in the same query as above Dim query As New WqlEventQuery("Win32_ComputerShutdownEvent ") MessageBox.Show(query.QueryString) End Function 'Main End Class 'EventSample
using System; using System.Management; public class EventSample { public static void Main(string[] args) { // Full query string specified to the constructor WqlEventQuery q = new WqlEventQuery("SELECT * FROM Win32_ComputerShutdownEvent"); // Only relevant event class name specified to the constructor // Results in the same query as above. WqlEventQuery query = new WqlEventQuery("Win32_ComputerShutdownEvent "); Console.WriteLine(query.QueryString); 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, String)
アセンブリ: System.Management (system.management.dll 内)

Dim eventClassName As String Dim condition As String Dim instance As New WqlEventQuery(eventClassName, condition)


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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ (String, TimeSpan)
アセンブリ: System.Management (system.management.dll 内)

Dim eventClassName As String Dim withinInterval As TimeSpan Dim instance As New WqlEventQuery(eventClassName, withinInterval)

イベントおよびイベントを受け取るまでの許容待機時間を指定する期間値を指定して、WqlEventQuery を初期化する例を次に示します。
Imports System Imports System.Management Public Class EventSample Public Overloads Shared Function _ Main(ByVal args() As String) As Integer ' Requests all instance creation events, ' with a specified latency of ' 10 seconds. The query created ' is "SELECT * FROM __InstanceCreationEvent WITHIN 10" Dim t As New TimeSpan(0, 0, 10) Dim q As New WqlEventQuery("__InstanceCreationEvent", t) MessageBox.Show(q.QueryString) End Function 'Main End Class 'EventSample
using System; using System.Management; public class EventSample { public static void Main(string[] args) { // Requests all instance creation events, // with a specified latency of // 10 seconds. The query created // is "SELECT * FROM __InstanceCreationEvent WITHIN 10" WqlEventQuery q = new WqlEventQuery("__InstanceCreationEvent" , new TimeSpan(0,0,10)); Console.WriteLine(q.QueryString); 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


WqlEventQuery コンストラクタ

名前 | 説明 |
---|---|
WqlEventQuery () | WqlEventQuery クラスの新しいインスタンスを初期化します。これは既定のコンストラクタです。 |
WqlEventQuery (String) | 指定したクエリ文字列またはイベント クラス名に基づいて、WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, String) | 指定した条件を使用して、指定したイベント クラス名の WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, TimeSpan) | 指定した待機時間を使用して、指定したイベント クラスの WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, String, TimeSpan) | 指定したイベント クラス名、条件、およびグループ化間隔を使用して、WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, TimeSpan, String) | 指定したイベント クラス名、ポーリング間隔、および条件を使用して、WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, String, TimeSpan, String[]) | 指定したイベント クラス名、条件、グループ化間隔、およびグループ化プロパティを使用して、WqlEventQuery クラスの新しいインスタンスを初期化します。 |
WqlEventQuery (String, TimeSpan, String, TimeSpan, String[], String) | 指定したイベント クラス名、条件、グループ化間隔、グループ化プロパティ、および指定したイベント数を使用して、WqlEventQuery クラスの新しいインスタンスを初期化します。 |

WqlEventQuery プロパティ

名前 | 説明 | |
---|---|---|
![]() | Condition | 指定したクラスのイベントに適用される条件を取得または設定します。 |
![]() | EventClassName | クエリを実行するイベント クラスを取得または設定します。 |
![]() | GroupByPropertyList | 同じ種類のイベントをグループ化するために使用するイベントのプロパティを取得または設定します。 |
![]() | GroupWithinInterval | 同じ種類のイベントをグループ化するために使用する間隔を取得または設定します。 |
![]() | HavingCondition | 受け取るイベントの数に基づいて、イベントの集約に適用する条件を取得または設定します。 |
![]() | QueryLanguage | オーバーライドされます。 クエリの言語を取得します。 |
![]() | QueryString | オーバーライドされます。 クエリを表す文字列を取得または設定します。 |
![]() | WithinInterval | クエリで使用するポーリング間隔を取得または設定します。 |

WqlEventQuery メソッド

名前 | 説明 | |
---|---|---|
![]() | Clone | オーバーライドされます。 オブジェクトのコピーを作成します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | BuildQuery | 現在のプロパティ値に応じてクエリ文字列を作成します。 |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | GetValueOfKeyword | ( ManagementQuery から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |
![]() | ParseQuery | オーバーライドされます。 クエリ文字列を解析し、その結果に応じてプロパティ値を設定します。 |

WqlEventQuery メンバ
WqlEventQuery データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Condition | 指定したクラスのイベントに適用される条件を取得または設定します。 |
![]() | EventClassName | クエリを実行するイベント クラスを取得または設定します。 |
![]() | GroupByPropertyList | 同じ種類のイベントをグループ化するために使用するイベントのプロパティを取得または設定します。 |
![]() | GroupWithinInterval | 同じ種類のイベントをグループ化するために使用する間隔を取得または設定します。 |
![]() | HavingCondition | 受け取るイベントの数に基づいて、イベントの集約に適用する条件を取得または設定します。 |
![]() | QueryLanguage | オーバーライドされます。 クエリの言語を取得します。 |
![]() | QueryString | オーバーライドされます。 クエリを表す文字列を取得または設定します。 |
![]() | WithinInterval | クエリで使用するポーリング間隔を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Clone | オーバーライドされます。 オブジェクトのコピーを作成します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | BuildQuery | 現在のプロパティ値に応じてクエリ文字列を作成します。 |
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | GetValueOfKeyword | ( ManagementQuery から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |
![]() | ParseQuery | オーバーライドされます。 クエリ文字列を解析し、その結果に応じてプロパティ値を設定します。 |

- WqlEventQueryのページへのリンク