当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET WqlEventQuery构造函数代码示例

本文整理汇总了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
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:20,代码来源:WqlEventQuery

示例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
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:19,代码来源:WqlEventQuery

示例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
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:19,代码来源:WqlEventQuery

示例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
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:23,代码来源:WqlEventQuery


注:本文中的System.Management.WqlEventQuery.WqlEventQuery构造函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。