WqlEventQuery 생성자

정의

WqlEventQuery 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
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()

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

WqlEventQuery 클래스의 새 인스턴스를 초기화합니다. 매개 변수가 없는 생성자입니다.

public:
 WqlEventQuery();
public WqlEventQuery();
Public Sub New ()

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 쿼리 문자열 또는 이벤트 클래스 이름을 기반으로 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ queryOrEventClassName);
public WqlEventQuery(string queryOrEventClassName);
new System.Management.WqlEventQuery : string -> System.Management.WqlEventQuery
Public Sub New (queryOrEventClassName As String)

매개 변수

queryOrEventClassName
String

전체 이벤트 쿼리 또는 쿼리할 이벤트 클래스의 이름을 나타내는 문자열입니다. 개체는 문자열을 유효한 이벤트 쿼리로 구문 분석하려고 합니다. 실패하면 파서는 매개 변수가 이벤트 클래스 이름을 나타낸다고 가정합니다.

예제

다음 예제에서는 쿼리를 WqlEventQuery 지정하여 초기화한 다음 이벤트를 지정하여 초기화합니다 WqlEventQuery .

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;
    }
}
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

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, String)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 조건을 사용하여 지정된 이벤트 클래스 이름에 대한 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, System::String ^ condition);
public WqlEventQuery(string eventClassName, string condition);
new System.Management.WqlEventQuery : string * string -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, condition As String)

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

condition
String

지정된 클래스의 이벤트에 적용할 조건입니다.

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, TimeSpan)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 대기 시간을 사용하여 지정된 이벤트 클래스에 대한 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, TimeSpan withinInterval);
public WqlEventQuery(string eventClassName, TimeSpan withinInterval);
new System.Management.WqlEventQuery : string * TimeSpan -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, withinInterval As TimeSpan)

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

withinInterval
TimeSpan

TimeSpan 이 이벤트를 수신하는 데 허용되는 대기 시간을 지정하는 값입니다. 이 값은 요청된 쿼리에 대한 명시적 이벤트 공급자가 없고 조건에 대해 폴링하는 데 WMI가 필요한 경우에 사용됩니다. 이 간격은 이벤트 알림을 전달하기 전에 전달할 수 있는 최대 시간입니다.

예제

다음 예제에서는 이 이벤트를 수신하는 데 허용되는 대기 시간을 지정하는 이벤트 및 시간 범위 값을 지정하여 초기화 WqlEventQuery 합니다.

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;
    }
}
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

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, String, TimeSpan)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 이벤트 클래스 이름, 조건 및 그룹화 간격을 사용하여 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, System::String ^ condition, TimeSpan groupWithinInterval);
public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval);
new System.Management.WqlEventQuery : string * string * TimeSpan -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, condition As String, groupWithinInterval As TimeSpan)

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

condition
String

지정된 클래스의 이벤트에 적용할 조건입니다.

groupWithinInterval
TimeSpan

WMI가 여러 이벤트가 아닌 하나를 aggregate event보내는 지정된 간격입니다.

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, TimeSpan, String)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 이벤트 클래스 이름, 폴링 간격 및 조건을 사용하여 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, TimeSpan withinInterval, System::String ^ condition);
public WqlEventQuery(string eventClassName, TimeSpan withinInterval, string condition);
new System.Management.WqlEventQuery : string * TimeSpan * string -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, withinInterval As TimeSpan, condition As String)

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

withinInterval
TimeSpan

TimeSpan 이 이벤트를 수신하는 데 허용되는 대기 시간을 지정하는 값입니다. 이 값은 요청된 쿼리에 대한 명시적 이벤트 공급자가 없고 조건에 대해 폴링하는 데 WMI가 필요한 경우에 사용됩니다. 이 간격은 이벤트 알림을 전달하기 전에 전달할 수 있는 최대 시간입니다.

condition
String

지정된 클래스의 이벤트에 적용할 조건입니다.

예제

다음 예제에서는 이벤트 쿼리를 만듭니다. "SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE TargetInstance ISA Win32_Service "는 10초 폴링 간격으로 Win32_Service 인스턴스 생성에 대한 알림을 보냅니다.

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;
    }
}
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

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, String, TimeSpan, String[])

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 이벤트 클래스 이름, 조건, 그룹화 간격 및 그룹화 속성을 사용하여 클래스의 WqlEventQuery 새 인스턴스를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, System::String ^ condition, TimeSpan groupWithinInterval, cli::array <System::String ^> ^ groupByPropertyList);
public WqlEventQuery(string eventClassName, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList);
new System.Management.WqlEventQuery : string * string * TimeSpan * string[] -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, condition As String, groupWithinInterval As TimeSpan, groupByPropertyList As String())

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

condition
String

지정된 클래스의 이벤트에 적용할 조건입니다.

groupWithinInterval
TimeSpan

WMI가 여러 이벤트가 아닌 하나를 aggregate event보내는 지정된 간격입니다.

groupByPropertyList
String[]

이벤트를 그룹화해야 하는 이벤트 클래스의 속성입니다.

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상

WqlEventQuery(String, TimeSpan, String, TimeSpan, String[], String)

Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs
Source:
ManagementQuery.cs

지정된 이벤트 클래스 이름, 조건, 그룹화 간격, 그룹화 속성 및 지정된 이벤트 수를 사용하여 클래스의 새 인스턴스 WqlEventQuery 를 초기화합니다.

public:
 WqlEventQuery(System::String ^ eventClassName, TimeSpan withinInterval, System::String ^ condition, TimeSpan groupWithinInterval, cli::array <System::String ^> ^ groupByPropertyList, System::String ^ havingCondition);
public WqlEventQuery(string eventClassName, TimeSpan withinInterval, string condition, TimeSpan groupWithinInterval, string[] groupByPropertyList, string havingCondition);
new System.Management.WqlEventQuery : string * TimeSpan * string * TimeSpan * string[] * string -> System.Management.WqlEventQuery
Public Sub New (eventClassName As String, withinInterval As TimeSpan, condition As String, groupWithinInterval As TimeSpan, groupByPropertyList As String(), havingCondition As String)

매개 변수

eventClassName
String

쿼리할 이벤트 클래스의 이름입니다.

withinInterval
TimeSpan

TimeSpan 이 이벤트를 수신하는 데 허용되는 대기 시간을 지정하는 값입니다. 이 값은 요청된 쿼리에 대한 명시적 이벤트 공급자가 없고 조건에 대해 폴링하는 데 WMI가 필요한 경우에 사용됩니다. 이 간격은 이벤트 알림을 전달하기 전에 전달할 수 있는 최대 시간입니다.

condition
String

지정된 클래스의 이벤트에 적용할 조건입니다.

groupWithinInterval
TimeSpan

WMI가 여러 이벤트가 아닌 하나를 aggregate event보내는 지정된 간격입니다.

groupByPropertyList
String[]

이벤트를 그룹화해야 하는 이벤트 클래스의 속성입니다.

havingCondition
String

이벤트 수에 적용할 조건입니다.

예제

다음 예제에서는 이벤트 쿼리를 만듭니다. "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA Win32_NTLogEvent GROUP WITHIN 600 BY TargetInstance.SourceName HAVING NumberOfEvents > 15"는 동일한 원본에서 받은 Win32_NTLogEvent 이벤트 수가 15를 초과하는 경우에만 집계 이벤트를 제공합니다.

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;
    }
}
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

설명

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상