ManagementObject.Scope 속성

정의

이 개체가 속한 범위를 가져오거나 설정합니다.

public:
 property System::Management::ManagementScope ^ Scope { System::Management::ManagementScope ^ get(); void set(System::Management::ManagementScope ^ value); };
public System.Management.ManagementScope Scope { get; set; }
member this.Scope : System.Management.ManagementScope with get, set
Public Property Scope As ManagementScope

속성 값

이 개체가 상주하는 범위입니다.

예제

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

using System;
using System.Management;
public class Sample
{
    public static void Main()
    {
        // Create the object with the default namespace
        // (root\cimv2)
        ManagementObject o = new ManagementObject();

        // Change the scope (=namespace) of this object
        // to the one specified.
        o.Scope = new ManagementScope("root\\CIMV2");
    }
}
Imports System.Management
Public Class Sample

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

        ' Create the object with the default namespace
        ' (root\cimv2)
        Dim o As New ManagementObject

        ' Change the scope (=namespace) of this object
        ' to the one specified.
        o.Scope = New ManagementScope("root\CIMV2")

        Return 0
    End Function
End Class

설명

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

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

.NET Framework 보안

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

적용 대상