ManagementPath クラス
アセンブリ: System.Management (system.management.dll 内)


ManagementPath クラスが WMI オブジェクトへのパスを解析する方法の例を次に示します。この例で解析されるパスは、クラスのインスタンスへのパスです。
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
using System; using System.Management; public class Sample { public static void Main() { // Get the WMI class path ManagementPath p = 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:"" } }

System.Management.ManagementPath


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ManagementPath コンストラクタ ()
アセンブリ: System.Management (system.management.dll 内)



Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ManagementPath コンストラクタ (String)
アセンブリ: System.Management (system.management.dll 内)


ManagementPath クラスが WMI オブジェクトへのパスを解析する方法の例を次に示します。この例で解析されるパスは、クラスのインスタンスへのパスです。
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
using System; using System.Management; public class Sample { public static void Main() { // Get the WMI class path ManagementPath p = 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:"" } }


Windows 98, Windows 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
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


ManagementPath コンストラクタ

名前 | 説明 |
---|---|
ManagementPath () | ManagementPath クラスの新しい空のインスタンスを初期化します。これは既定のコンストラクタです。 |
ManagementPath (String) | 特定パスの ManagementPath クラスの新しいインスタンスを初期化します。 |

ManagementPath プロパティ

名前 | 説明 | |
---|---|---|
![]() | IsClass | クラス パスかどうかを示す値を取得または設定します。 |
![]() | IsInstance | インスタンス パスかどうかを示す値を取得または設定します。 |
![]() | IsSingleton | シングルトン インスタンス パスかどうかを示す値を取得または設定します。 |
![]() | NamespacePath | パスの名前空間部分を取得または設定します。別個に取得できるサーバー名は含まれていないことに注意してください。 |
![]() | Path | オブジェクトの完全パスの文字列形式を取得または設定します。 |
![]() | RelativePath | 相対パス、つまりクラス名とキーだけを取得または設定します。 |
![]() | Server | パスのサーバー部分を取得または設定します。 |

ManagementPath メソッド

名前 | 説明 | |
---|---|---|
![]() | Clone | ManagementPath のコピーを返します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | SetAsClass | 新しいクラス パスとしてパスを設定します。つまり、パスにキー値ではなく、クラス名を要求します。 |
![]() | SetAsSingleton | 新しいシングルトン オブジェクト パスとしてパスを設定します。つまり、これはインスタンスへのパスですが、キー値はありません。 |
![]() | ToString | オーバーライドされます。 オブジェクトの完全パスを文字列形式として返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |


ManagementPath メンバ
WMI (Windows Management Instrumentation) オブジェクトへのパスを解析および構築するためのラッパーを提供します。
ManagementPath データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | IsClass | クラス パスかどうかを示す値を取得または設定します。 |
![]() | IsInstance | インスタンス パスかどうかを示す値を取得または設定します。 |
![]() | IsSingleton | シングルトン インスタンス パスかどうかを示す値を取得または設定します。 |
![]() | NamespacePath | パスの名前空間部分を取得または設定します。別個に取得できるサーバー名は含まれていないことに注意してください。 |
![]() | Path | オブジェクトの完全パスの文字列形式を取得または設定します。 |
![]() | RelativePath | 相対パス、つまりクラス名とキーだけを取得または設定します。 |
![]() | Server | パスのサーバー部分を取得または設定します。 |

名前 | 説明 | |
---|---|---|
![]() | Clone | ManagementPath のコピーを返します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | SetAsClass | 新しいクラス パスとしてパスを設定します。つまり、パスにキー値ではなく、クラス名を要求します。 |
![]() | SetAsSingleton | 新しいシングルトン オブジェクト パスとしてパスを設定します。つまり、これはインスタンスへのパスですが、キー値はありません。 |
![]() | ToString | オーバーライドされます。 オブジェクトの完全パスを文字列形式として返します。 |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |


- ManagementPathのページへのリンク