ManagementObject.Scope プロパティ
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
このオブジェクトが存在するスコープを取得または設定します。
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 クラスの新しいインスタンスを初期化し、 ManagementObjectのスコープを変更します。
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 オブジェクトが解放されます。 これにより、管理オブジェクトは、新しいパスプロパティとスコープ値で指定された新しいオブジェクトにリバインドされます。
再バインドは"遅延" 方式で実行されます。つまり、要求された値で管理オブジェクトを WMI オブジェクトにバインドする必要がある場合にのみ実行されます。 再バインドを試みる前に、このプロパティ以上の変更を行うことができます (たとえば、スコープとパスのプロパティを同時に変更するなど)。
.NET Framework のセキュリティ
直接呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されたコードでは使用できません。 詳細については、「 部分信頼コードからのライブラリの使用」を参照してください。