WqlEventQuery 생성자

정의

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

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

지정된 쿼리 문자열이나 이벤트 클래스 이름에 따라 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

지정된 조건을 사용하여 지정된 이벤트 클래스 이름에 대한 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

지정된 대기 시간을 사용하여 지정된 이벤트 클래스에 대한 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

지정된 이벤트 클래스 이름, 조건, 그룹화 간격 등을 사용하여 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가 여러 이벤트가 아닌 1 aggregate event개를 보내는 지정된 간격입니다.

설명

.NET Framework 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상

WqlEventQuery(String, TimeSpan, String)

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

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

예제

다음 예제에서는 이벤트 쿼리: "선택 * __InstanceCreationEvent에서 WITHIN 10 여기서 TargetInstance ISA Win32_Service"를 만들기에 대 한 알림을 보내는 Win32_Service10 초 폴링 간격을 사용 하 여 인스턴스.

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

지정된 이벤트 클래스 이름, 조건, 그룹화 간격, 그룹화 속성 등을 사용하여 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가 여러 이벤트가 아닌 1 aggregate event개를 보내는 지정된 간격입니다.

groupByPropertyList
String[]

이벤트 그룹화의 기준으로 사용할 이벤트 클래스의 속성입니다.

설명

.NET Framework 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상

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

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가 여러 이벤트가 아닌 1 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 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상