ManagementPath Class
.NET Framework 3.0
Provides a wrapper for parsing and building paths to WMI objects.
Namespace: System.Management
Assembly: System.Management (in system.management.dll)
Assembly: System.Management (in system.management.dll)
'Declaration <TypeConverterAttribute(GetType(ManagementPathConverter))> _ Public Class ManagementPath Implements ICloneable 'Usage Dim instance As ManagementPath
/** @attribute TypeConverterAttribute(System.Management.ManagementPathConverter) */ public class ManagementPath implements ICloneable
TypeConverterAttribute(System.Management.ManagementPathConverter) public class ManagementPath implements ICloneable
Not applicable.
The following example demonstrates how the ManagementPath class parses a path to a WMI object. The path that is parsed in the example is a path to an instance of a class.
Imports System Imports System.Management Public Class Sample Public Overloads Shared Function _ Main(ByVal args() As String) As Integer ' Get the WMI class path Dim p As ManagementPath = _ New ManagementPath( _ "\\ComputerName\root" & _ "\cimv2:Win32_LogicalDisk.DeviceID=""C:""") Console.WriteLine("IsClass: " & _ p.IsClass) ' Should be False (because it is an instance) Console.WriteLine("IsInstance: " & _ p.IsInstance) ' Should be True Console.WriteLine("ClassName: " & _ p.ClassName) ' Should be "Win32_LogicalDisk" Console.WriteLine("NamespacePath: " & _ p.NamespacePath) ' Should be "ComputerName\cimv2" Console.WriteLine("Server: " & _ p.Server) ' Should be "ComputerName" Console.WriteLine("Path: " & _ p.Path) ' Should be "ComputerName\root\cimv2: ' Win32_LogicalDisk.DeviceId="C:"" Console.WriteLine("RelativePath: " & _ p.RelativePath) ' Should be "Win32_LogicalDisk.DeviceID="C:"" End Function End Class
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: