Editar

Compartir a través de


ManagementObject.ClassPath Property

Definition

Gets or sets the path to the object's class.

public:
 virtual property System::Management::ManagementPath ^ ClassPath { System::Management::ManagementPath ^ get(); };
public override System.Management.ManagementPath ClassPath { get; }
member this.ClassPath : System.Management.ManagementPath
Public Overrides ReadOnly Property ClassPath As ManagementPath

Property Value

A ManagementPath representing the path to the object's class.

Examples

The following example initializes a new instance of the ManagementObject class and then retrieves the class path for the 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

Remarks

This property is read-only.

.NET Framework Security

Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.

Applies to