次の方法で共有


ManagementObject.Path プロパティ

オブジェクトの WMI パスを取得または設定します。

Public Overridable Property Path As ManagementPath
[C#]
public virtual ManagementPath Path {get; set;}
[C++]
public: __property virtual ManagementPath* get_Path();public: __property virtual void set_Path(ManagementPath*);
[JScript]
public function get Path() : ManagementPath;public function set Path(ManagementPath);

プロパティ値

オブジェクトのパスを表す ManagementPath

解説

特定の名前空間で、管理オブジェクトを WMI オブジェクトにバインドした後にプロパティを変更した場合、元の WMI オブジェクトは解放されます。これにより、管理オブジェクトは、新しいパス プロパティとスコープ値が指定する新しいオブジェクトに再バインドされます。

再バインディングは、最も負荷の少ない方法で実行されます。つまり、要求された値が、管理オブジェクトを WMI オブジェクトにバインドすることを要求したときにだけ実行されます。再バインドを試行する前に複数のプロパティを変更できます。たとえば、スコープとパスのプロパティを同時に変更できます。

使用例

 
ManagementObject o = new ManagementObject(); 

//Specify the WMI path to which this object should be bound to
o.Path = new ManagementPath("MyClass.Name='foo'");
   
[Visual Basic] 
Dim o As New ManagementObject()

'Specify the WMI path to which this object should be bound to
o.Path = New ManagementPath("MyClass.Name=""foo""");
   

[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 名前空間