本文整理汇总了VB.NET中System.Management.WqlEventQuery.WqlEventQuery构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET WqlEventQuery构造函数的具体用法?VB.NET WqlEventQuery怎么用?VB.NET WqlEventQuery使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。
在下文中一共展示了WqlEventQuery构造函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: EventSample
' 导入命名空间
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
示例2: EventSample
' 导入命名空间
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
示例3: EventSample
' 导入命名空间
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
示例4: EventSample
' 导入命名空间
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