次の方法で共有


RelatedObjectQuery.RelatedClass プロパティ

エンドポイント オブジェクトのクラスを取得または設定します。

Public Property RelatedClass As String
[C#]
public string RelatedClass {get; set;}
[C++]
public: __property String* get_RelatedClass();public: __property void set_RelatedClass(String*);
[JScript]
public function get RelatedClass() : String;public function set RelatedClass(String);

プロパティ値

関連クラス名を格納している文字列。

解説

このプロパティ値を設定すると、それまでにオブジェクトに格納された値をすべてオーバーライドします。クエリ文字列は新しい関連クラスを反映するようにリビルドされます。

使用例

[Visual Basic, C#] コンピュータで使用できるすべての Win32 サービスを検索するには、このプロパティを "Win32_Service" に設定します。

 
RelatedObjectQuery q = new RelatedObjectQuery("Win32_ComputerSystem='MySystem'");
q.RelatedClass = "Win32_Service";
   
[Visual Basic] 
Dim q As New RelatedObjectQuery("Win32_ComputerSystem=""MySystem""")
q.RelatedClass = "Win32_Service"
   

[C++, JScript] C++ および JScript のサンプルはありません。Visual Basic および C# のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

.NET Framework セキュリティ:

参照

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