ManagementPath.IsInstance プロパティ
アセンブリ: 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からManagementPath.IsInstance プロパティを検索する場合は、下記のリンクをクリックしてください。

- ManagementPath.IsInstance プロパティのページへのリンク