オブジェクトが存在するスコープを取得または設定します。
Public Property Scope As ManagementScope
[C#]
public ManagementScope Scope {get; set;}
[C++]
public: __property ManagementScope* get_Scope();public: __property void set_Scope(ManagementScope*);
[JScript]
public function get Scope() : ManagementScope;public function set Scope(ManagementScope);
プロパティ値
解説
特定の名前空間で、管理オブジェクトを WMI オブジェクトにバインドした後にプロパティを変更した場合、元の WMI オブジェクトは解放されます。これにより、管理オブジェクトは、新しいパス プロパティとスコープ値が指定する新しいオブジェクトに再バインドされます。
再バインディングは、最も負荷の少ない方法で実行されます。つまり、要求された値が、管理オブジェクトを WMI オブジェクトにバインドすることを要求したときにだけ実行されます。再バインドを試行する前に複数のプロパティを変更できます。たとえば、スコープとパスのプロパティを同時に変更できます。
使用例
//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\\MyAppNamespace");
[Visual Basic]
'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\MyAppNamespace")
[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
.NET Framework セキュリティ:
- 直前の呼び出し元の完全信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細の参照先 : 部分信頼コードからのライブラリの使用
参照
ManagementObject クラス | ManagementObject メンバ | System.Management 名前空間