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


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

本文整理汇总了VB.NET中System.Management.ManagementObject.ManagementObject构造函数的典型用法代码示例。如果您正苦于以下问题:VB.NET ManagementObject构造函数的具体用法?VB.NET ManagementObject怎么用?VB.NET ManagementObject使用的例子?那么恭喜您, 这里精选的构造函数代码示例或许可以为您提供帮助。


在下文中一共展示了ManagementObject构造函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        Dim o As New ManagementObject

        Dim mp As New _
            ManagementPath("Win32_LogicalDisk='c:'")

        ' Now set the path on this object to
        ' bind it to a 'real' manageable entity
        o.Path = mp

        'Now it can be used 
        Console.WriteLine(o("FreeSpace"))

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:22,代码来源:ManagementObject

示例2: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        Dim p As New ManagementPath( _
            "Win32_Service.Name=""Alerter""")
        Dim o As New ManagementObject(p)

        'Now it can be used 
        Console.WriteLine(o("Name"))

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:17,代码来源:ManagementObject

示例3: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        Dim o As New ManagementObject( _
    "Win32_Service.Name=""Alerter""")

        ' or with a full path :

        Dim mObj As New ManagementObject( _
            "\\\\MyServer\\root\\MyApp:MyClass.Key=""abc""")

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:18,代码来源:ManagementObject

示例4: Main

' 导入命名空间
Imports System.Management

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

        Dim p As New ManagementPath("Win32_Service")

        ' Set options for no context info
        ' but requests amended qualifiers 
        ' to be contained in the object
        Dim opt As New ObjectGetOptions( _
            Nothing, TimeSpan.MaxValue, True)

        Dim c As New ManagementClass(p, opt)

        Console.WriteLine(c.Qualifiers("Description").Value)

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:22,代码来源:ManagementObject

示例5: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        ' Set options for no context info, 
        ' but requests amended qualifiers
        ' to be contained in the object
        Dim opt As New ObjectGetOptions( _
            Nothing, System.TimeSpan.MaxValue, True)

        Dim o As New ManagementObject( _
            "Win32_Service", opt)

        Console.WriteLine(o.GetQualifierValue("Description"))

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:21,代码来源:ManagementObject

示例6: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        Dim s As New ManagementScope( _
            "\\MyMachine\root\cimv2")
        Dim p As New ManagementPath( _
            "Win32_Service")

        ' Set options for no context info,
        ' but requests amended qualifiers 
        ' to be contained in the object
        Dim opt As ObjectGetOptions
        opt = New ObjectGetOptions( _
                Nothing, TimeSpan.MaxValue, True)

        Dim o As ManagementObject
        o = New ManagementObject(s, p, opt)

        Console.WriteLine(o.Qualifiers("Description").Value)

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:27,代码来源:ManagementObject

示例7: Sample_ManagementClass

' 导入命名空间
Imports System.Management

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

        Dim opt As New ObjectGetOptions( _
            Nothing, System.TimeSpan.MaxValue, True)
        Dim o As New ManagementObject( _
            "root\MyNamespace", "MyClass", opt)

        Return 0
    End Function
End Class
开发者ID:VB.NET开发者,项目名称:System.Management,代码行数:15,代码来源:ManagementObject


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