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

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

次の例では、既定の名前空間を使用して ManagementObject クラスの新しいインスタンスを初期化し、次に 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 のセキュリティ

直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「 部分的に信頼されたコードからのライブラリの使用」を参照してください。

適用対象