ManagementPath コンストラクタとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ManagementPath コンストラクタの意味・解説 

ManagementPath コンストラクタ (String)

特定パスの ManagementPath クラス新しインスタンス初期化します。

名前空間: System.Management
アセンブリ: System.Management (system.management.dll 内)
構文構文

public ManagementPath (
    string path
)
public:
ManagementPath (
    String^ path
)
public ManagementPath (
    String path
)
public function ManagementPath (
    path : String
)

パラメータ

path

オブジェクト パス

使用例使用例

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:""

    }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

ManagementPath コンストラクタ


オーバーロードの一覧オーバーロードの一覧

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

関連項目

ManagementPath クラス
ManagementPath メンバ
System.Management 名前空間

ManagementPath コンストラクタ ()




英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「ManagementPath コンストラクタ」の関連用語

ManagementPath コンストラクタのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ManagementPath コンストラクタのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS