WqlEventQuery.QueryString Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the string representing the query.
public:
virtual property System::String ^ QueryString { System::String ^ get(); void set(System::String ^ value); };
public override string QueryString { get; set; }
member this.QueryString : string with get, set
Public Overrides Property QueryString As String
Property Value
Returns a String value containing the query.
Examples
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
Remarks
Property Value
A string representing the query.
.NET Framework Security
Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET