ManagementObject.GetRelated Metoda
Definicja
Ważne
Niektóre informacje odnoszą się do produktu w wersji wstępnej, który może zostać znacząco zmodyfikowany przed wydaniem. Firma Microsoft nie udziela żadnych gwarancji, jawnych lub domniemanych, w odniesieniu do informacji podanych w tym miejscu.
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
Przeciążenia
| Nazwa | Opis |
|---|---|
| GetRelated() |
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie). |
| GetRelated(ManagementOperationObserver) |
Pobiera kolekcję obiektów powiązanych z obiektem (asocjatorami) asynchronicznie. To wywołanie jest zwracane natychmiast, a delegat jest wywoływany, gdy wyniki są dostępne. |
| GetRelated(String) |
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie). |
| GetRelated(ManagementOperationObserver, String) |
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie). |
| GetRelated(String, String, String, String, String, String, Boolean, EnumerationOptions) |
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie). |
| GetRelated(ManagementOperationObserver, String, String, String, String, String, String, Boolean, EnumerationOptions) |
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie). |
GetRelated()
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
public:
System::Management::ManagementObjectCollection ^ GetRelated();
public System.Management.ManagementObjectCollection GetRelated();
member this.GetRelated : unit -> System.Management.ManagementObjectCollection
Public Function GetRelated () As ManagementObjectCollection
Zwraca
Obiekt ManagementObjectCollection zawierający powiązane obiekty.
Przykłady
Poniższy przykład wywołuje metodę GetRelated w celu pobrania kolekcji obiektów powiązanych z wystąpieniem ManagementObject klasy.
using System;
using System.Management;
public class Sample
{
public static void Main(string[] args)
{
ManagementObject o =
new ManagementObject("Win32_Service='Alerter'");
foreach(ManagementObject b in o.GetRelated())
Console.WriteLine(
"Object related to Alerter service : {0}",
b.ClassPath);
}
}
Imports System.Management
Class Sample_ManagementClass
Public Overloads Shared Function Main( _
ByVal args() As String) As Integer
Dim o As New ManagementObject( _
"Win32_Service=""Alerter""")
Dim b As ManagementObject
For Each b In o.GetRelated()
Console.WriteLine( _
"Object related to Alerter service : {0}", _
b.ClassPath)
Next b
Return 0
End Function
End Class
Uwagi
Operacja jest równoważna asocjatorom zapytania, w którym ResultClass = relatedClass.
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).
Dotyczy
GetRelated(ManagementOperationObserver)
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (asocjatorami) asynchronicznie. To wywołanie jest zwracane natychmiast, a delegat jest wywoływany, gdy wyniki są dostępne.
public:
void GetRelated(System::Management::ManagementOperationObserver ^ watcher);
public void GetRelated(System.Management.ManagementOperationObserver watcher);
member this.GetRelated : System.Management.ManagementOperationObserver -> unit
Public Sub GetRelated (watcher As ManagementOperationObserver)
Parametry
- watcher
- ManagementOperationObserver
Obiekt, który ma być używany do zwracania wyników.
Uwagi
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).
Dotyczy
GetRelated(String)
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
public:
System::Management::ManagementObjectCollection ^ GetRelated(System::String ^ relatedClass);
public System.Management.ManagementObjectCollection GetRelated(string relatedClass);
member this.GetRelated : string -> System.Management.ManagementObjectCollection
Public Function GetRelated (relatedClass As String) As ManagementObjectCollection
Parametry
- relatedClass
- String
Klasa powiązanych obiektów.
Zwraca
Obiekt ManagementObjectCollection zawierający powiązane obiekty.
Przykłady
Poniższy przykład wywołuje metodę GetRelated w celu pobrania kolekcji obiektów powiązanych z wystąpieniem ManagementObject klasy.
using System;
using System.Management;
public class Sample
{
public static void Main(string[] args)
{
ManagementObject o =
new ManagementObject("Win32_Service='Alerter'");
foreach (ManagementObject b in
o.GetRelated("Win32_Service"))
Console.WriteLine(
"Service related to the Alerter service {0} is {1}",
b["Name"], b["State"]);
}
}
Imports System.Management
Class Sample_ManagementClass
Public Overloads Shared Function Main( _
ByVal args() As String) As Integer
Dim o As New ManagementObject( _
"Win32_Service=""Alerter""")
Dim b As ManagementObject
For Each b In o.GetRelated("Win32_Service")
Console.WriteLine( _
"Service related to the Alerter service {0} is {1}", _
b("Name"), b("State"))
Next b
Return 0
End Function
End Class
Uwagi
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).
Dotyczy
GetRelated(ManagementOperationObserver, String)
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
public:
void GetRelated(System::Management::ManagementOperationObserver ^ watcher, System::String ^ relatedClass);
public void GetRelated(System.Management.ManagementOperationObserver watcher, string relatedClass);
member this.GetRelated : System.Management.ManagementOperationObserver * string -> unit
Public Sub GetRelated (watcher As ManagementOperationObserver, relatedClass As String)
Parametry
- watcher
- ManagementOperationObserver
Obiekt, który ma być używany do zwracania wyników.
- relatedClass
- String
Klasa powiązanych obiektów.
Uwagi
Ta operacja jest równoważna asocjatorom zapytania, w którym ResultClass = relatedClass.
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).
Dotyczy
GetRelated(String, String, String, String, String, String, Boolean, EnumerationOptions)
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
public:
System::Management::ManagementObjectCollection ^ GetRelated(System::String ^ relatedClass, System::String ^ relationshipClass, System::String ^ relationshipQualifier, System::String ^ relatedQualifier, System::String ^ relatedRole, System::String ^ thisRole, bool classDefinitionsOnly, System::Management::EnumerationOptions ^ options);
public System.Management.ManagementObjectCollection GetRelated(string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, bool classDefinitionsOnly, System.Management.EnumerationOptions options);
member this.GetRelated : string * string * string * string * string * string * bool * System.Management.EnumerationOptions -> System.Management.ManagementObjectCollection
Public Function GetRelated (relatedClass As String, relationshipClass As String, relationshipQualifier As String, relatedQualifier As String, relatedRole As String, thisRole As String, classDefinitionsOnly As Boolean, options As EnumerationOptions) As ManagementObjectCollection
Parametry
- relatedClass
- String
Klasa powiązanych obiektów.
- relationshipClass
- String
Klasa zainteresowań relacji.
- relationshipQualifier
- String
Kwalifikator wymagany do obecności w klasie relacji.
- relatedQualifier
- String
Kwalifikator wymagany do obecności w powiązanej klasie.
- relatedRole
- String
Rola, jaką odgrywa powiązana klasa w relacji.
- thisRole
- String
Rola, jaką ta klasa odgrywa w relacji.
- classDefinitionsOnly
- Boolean
Gdy ta metoda zwraca, zawiera tylko definicje klas dla wystąpień, które są zgodne z zapytaniem.
- options
- EnumerationOptions
Rozszerzone opcje wykonywania zapytania.
Zwraca
Obiekt ManagementObjectCollection zawierający powiązane obiekty.
Uwagi
Ta operacja jest równoważna asocjatorom zapytania, w którym ResultClass = relatedClass.
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).
Dotyczy
GetRelated(ManagementOperationObserver, String, String, String, String, String, String, Boolean, EnumerationOptions)
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
- Źródło:
- ManagementObject.cs
Pobiera kolekcję obiektów powiązanych z obiektem (kojarzenie).
public:
void GetRelated(System::Management::ManagementOperationObserver ^ watcher, System::String ^ relatedClass, System::String ^ relationshipClass, System::String ^ relationshipQualifier, System::String ^ relatedQualifier, System::String ^ relatedRole, System::String ^ thisRole, bool classDefinitionsOnly, System::Management::EnumerationOptions ^ options);
public void GetRelated(System.Management.ManagementOperationObserver watcher, string relatedClass, string relationshipClass, string relationshipQualifier, string relatedQualifier, string relatedRole, string thisRole, bool classDefinitionsOnly, System.Management.EnumerationOptions options);
member this.GetRelated : System.Management.ManagementOperationObserver * string * string * string * string * string * string * bool * System.Management.EnumerationOptions -> unit
Public Sub GetRelated (watcher As ManagementOperationObserver, relatedClass As String, relationshipClass As String, relationshipQualifier As String, relatedQualifier As String, relatedRole As String, thisRole As String, classDefinitionsOnly As Boolean, options As EnumerationOptions)
Parametry
- watcher
- ManagementOperationObserver
Obiekt, który ma być używany do zwracania wyników.
- relatedClass
- String
Klasa powiązanych obiektów.
- relationshipClass
- String
Klasa zainteresowań relacji.
- relationshipQualifier
- String
Kwalifikator wymagany do obecności w klasie relacji.
- relatedQualifier
- String
Kwalifikator wymagany do obecności w powiązanej klasie.
- relatedRole
- String
Rola, jaką odgrywa powiązana klasa w relacji.
- thisRole
- String
Rola, jaką ta klasa odgrywa w relacji.
- classDefinitionsOnly
- Boolean
Zwracaj tylko definicje klas dla wystąpień, które pasują do zapytania.
- options
- EnumerationOptions
Rozszerzone opcje wykonywania zapytania.
Uwagi
Ta operacja jest równoważna asocjatorom zapytania, w którym ResultClass = relatedClass.
Zabezpieczenia programu .NET Framework
Pełne zaufanie dla bezpośredniego obiektu wywołującego. Tego elementu członkowskiego nie można używać przez częściowo zaufany kod. Aby uzyskać więcej informacji, zobacz Using Libraries from Partially Trusted Code (Używanie bibliotek z częściowo zaufanego kodu).