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 스를 사용하여 클래스의 새 인스턴스를 초기화한 다음 WMI 경로를 ManagementObject변경합니다.

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 개체가 해제됩니다. 이렇게 하면 관리 개체가 새 경로 속성 및 범위 값으로 지정된 새 개체로 다시 설정됩니다.

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

.NET Framework 보안

즉시 호출자에 대한 완전 신뢰입니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분적으로 신뢰할 수 있는 코드의 라이브러리 사용을 참조하세요.

적용 대상