ManagementObject.Path 속성

정의

개체의 WMI 경로를 가져오거나 설정합니다.

public:
 virtual property System::Management::ManagementPath ^ Path { System::Management::ManagementPath ^ get(); void set(System::Management::ManagementPath ^ value); };
public virtual System.Management.ManagementPath Path { get; set; }
member this.Path : System.Management.ManagementPath with get, set
Public Overridable Property Path As ManagementPath

속성 값

개체의 경로를 나타내는 ManagementPath입니다.

예제

다음 예제에서는 기본 네임스페이스를 사용하여 클래스의 ManagementObject 새 instance 초기화한 다음 의 ManagementObjectWMI 경로를 변경합니다.

using System;
using System.Management;
public class Sample
{
    public static void Main()
    {
        ManagementObject o = new ManagementObject();

        // Specify the WMI path to which
        // this object should be bound to
        o.Path = new ManagementPath(
            "Win32_Process.Name='calc.exe'");
    }
}
Imports System.Management
Public Class Sample

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

        Dim o As New ManagementObject

        ' Specify the WMI path to which 
        ' this object should be bound to
        o.Path = New ManagementPath( _
            "Win32_Process.Name=""calc.exe""")

        Return 0
    End Function
End Class

설명

관리 개체가 특정 네임스페이스의 WMI 개체에 바인딩된 후 속성을 변경하면 원래 WMI 개체가 해제됩니다. 이렇게 하면 관리 개체가 새 경로 속성 및 scope 값으로 지정된 새 개체로 다시 설정됩니다.

다시 바인딩은 요청된 값이 관리 개체를 WMI 개체에 바인딩해야 하는 경우에만 "지연" 방식으로 수행됩니다. 다시 바인딩을 시도하기 전에 속성 이상으로 변경할 수 있습니다(예: scope 및 경로 속성을 동시에 수정).

.NET Framework 보안

직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드에서 라이브러리를 사용 하 여입니다.

적용 대상