RelatedObjectQuery.RelatedClass 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定端點物件的類別(相關類別)。
public:
property System::String ^ RelatedClass { System::String ^ get(); void set(System::String ^ value); };
public string RelatedClass { get; set; }
member this.RelatedClass : string with get, set
Public Property RelatedClass As String
屬性值
回傳 String 包含相關類別名稱的值。
範例
以下範例將 WMI 類別設定為與 相關聯 RelatedObjectQuery。
using System;
using System.Management;
class Sample
{
public static void Main(string[] args)
{
RelatedObjectQuery q =
new RelatedObjectQuery("Win32_ComputerSystem='MySystem'");
q.RelatedClass = "Win32_Service";
}
}
Imports System.Management
Public Class Sample
Public Overloads Shared Function _
Main(ByVal args() As String) As Integer
Dim q As New RelatedObjectQuery( _
"Win32_ComputerSystem=""MySystem""")
q.RelatedClass = "Win32_Service"
End Function
End Class
備註
設定此屬性值會覆蓋物件中先前儲存的任何值。 查詢字串會被重建以反映新的相關類別。
屬性值
一個包含相關類別名稱的字串。
.NET Framework 安全性
完全信任當下的來電者。 此成員無法被部分受信任的程式碼使用。 欲了解更多資訊,請參閱 「部分受信任程式碼的函式庫使用」。