本文整理汇总了VB.NET中System.Management.EnumerationOptions.EnumerationOptions构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET EnumerationOptions构造函数的具体用法?VB.NET EnumerationOptions怎么用?VB.NET EnumerationOptions使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。您也可以进一步了解该构造函数所在类System.Management.EnumerationOptions
的用法示例。
在下文中一共展示了EnumerationOptions构造函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: RemoteConnect
' 导入命名空间
Imports System.Management
Public Class RemoteConnect
Public Overloads Shared Function Main( _
ByVal args() As String) As Integer
Dim opt As New EnumerationOptions
' Will enumerate instances of the given class
' and any subclasses.
opt.EnumerateDeep = True
Dim mngmtClass As New ManagementClass("CIM_Service")
Dim o As ManagementObject
For Each o In mngmtClass.GetInstances(opt)
Console.WriteLine(o("Name"))
Next o
Return 0
End Function
End Class
示例2: RemoteConnect
' 导入命名空间
Imports System.Management
Public Class RemoteConnect
Public Overloads Shared Function Main( _
ByVal args() As String) As Integer
Dim opt As EnumerationOptions
Opt = New EnumerationOptions( _
Nothing, System.TimeSpan.MaxValue, _
1, True, True, False, _
True, False, False, True)
Dim mngmtClass As New ManagementClass("CIM_Service")
Dim o As ManagementObject
For Each o In mngmtClass.GetInstances(opt)
Console.WriteLine(o("Name"))
Next o
Return 0
End Function
End Class