WqlEventQuery.GroupWithinInterval Propriedade

Definição

Obtém ou define o intervalo a ser usado para o agrupamento de eventos do mesmo tipo.Gets or sets the interval to be used for grouping events of the same type.

public:
 property TimeSpan GroupWithinInterval { TimeSpan get(); void set(TimeSpan value); };
public TimeSpan GroupWithinInterval { get; set; }
member this.GroupWithinInterval : TimeSpan with get, set
Public Property GroupWithinInterval As TimeSpan

Valor da propriedade

TimeSpan

Retorna um TimeSpan valor que contém o intervalo usado para agrupar eventos do mesmo tipo.Returns a TimeSpan value containing the interval used for grouping events of the same type.

Exemplos

O exemplo a seguir inicializa um novo WqlEventQuery e exibe a cadeia de caracteres de consulta de evento.The following example initializes a new WqlEventQuery and displays the event query string.

using System;
using System.Management;

public class EventSample
{
    public static void Main(string[] args)
    {
        WqlEventQuery query = new WqlEventQuery();
        query.EventClassName = "__InstanceCreationEvent";
        query.Condition = "TargetInstance ISA 'Win32_NTLogEvent'";
        query.GroupWithinInterval = new TimeSpan(0, 0, 10);
        System.Collections.Specialized.StringCollection collection =
            new System.Collections.Specialized.StringCollection();
        collection.Add("TargetInstance.SourceName");
        query.GroupByPropertyList = collection;
        query.HavingCondition = "NumberOfEvents > 25";

        Console.WriteLine(query.QueryString);
        return;
    }
}
Imports System.Management


Public Class EventSample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        Dim query As New WqlEventQuery
        query.EventClassName = "__InstanceCreationEvent"
        query.Condition = "TargetInstance ISA 'Win32_NTLogEvent'"
        query.GroupWithinInterval = New TimeSpan(0, 0, 10)
        Dim collection As New System.Collections.Specialized. _
            StringCollection
        collection.Add("TargetInstance.SourceName")
        query.GroupByPropertyList = collection
        query.HavingCondition = "NumberOfEvents > 25"

        MessageBox.Show(query.QueryString)

    End Function 'Main
End Class

Comentários

Definir esse valor de propriedade substitui qualquer valor anterior armazenado no objeto.Setting this property value overrides any previous value stored in the object. A cadeia de caracteres de consulta é recriada para refletir o novo intervalo.The query string is rebuilt to reflect the new interval.

Valor da propriedadeProperty Value

NULL, se não houver agrupamento envolvido; caso contrário, o intervalo no qual o WMI deve agrupar eventos do mesmo tipo.Null, if there is no grouping involved; otherwise, the interval in which WMI should group events of the same type.

Segurança do .NET Framework.NET Framework Security

Confiança total para o chamador imediato.Full trust for the immediate caller. Este membro não pode ser usado pelo código parcialmente confiável.This member cannot be used by partially trusted code. Para obter mais informações, consulte usando bibliotecas de código parcialmente confiável.For more information, see Using Libraries from Partially Trusted Code.

Aplica-se a