ManagementPath.RelativePath 속성 본문

[PL]/VB & VB.NET

ManagementPath.RelativePath 속성

객과 함께. 2010. 6. 26. 19:34

상대 경로, 즉 클래스 이름과 키만 가져오거나 설정합니다.

 

Imports System
Imports System.Management


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

        ' Get the WMI class path
        Dim p As ManagementPath = _
            New ManagementPath( _
            "\\ComputerName\root" & _
            "\cimv2:Win32_LogicalDisk.DeviceID=""C:""")

        Console.WriteLine("IsClass: " & _
            p.IsClass)
        ' Should be False (because it is an instance)

        Console.WriteLine("IsInstance: " & _
            p.IsInstance)
        ' Should be True

        Console.WriteLine("ClassName: " & _
            p.ClassName)
        ' Should be "Win32_LogicalDisk"

        Console.WriteLine("NamespacePath: " & _
            p.NamespacePath)
        ' Should be "ComputerName\cimv2"

        Console.WriteLine("Server: " & _
            p.Server)
        ' Should be "ComputerName"

        Console.WriteLine("Path: " & _
            p.Path)
        ' Should be "ComputerName\root\cimv2:
        ' Win32_LogicalDisk.DeviceId="C:""

        Console.WriteLine("RelativePath: " & _
            p.RelativePath)
        ' Should be "Win32_LogicalDisk.DeviceID="C:""

    End Function
End Class

 

출처 : MSDN

'[PL] > VB & VB.NET' 카테고리의 다른 글

dll파일 적용방법  (0) 2010.08.14
명령줄 컴파일 하기.  (0) 2010.08.13
[VB 2008] XML 문서예제  (0) 2010.01.19
[ VB 2008 ] 데이터베이스예제 .sdf  (0) 2010.01.19
[ VB 2008 ] COLOR View예제.  (0) 2010.01.11