Share via


RelationshipQuery Konstruktory

Definice

Inicializuje novou instanci RelationshipQuery třídy .

Přetížení

RelationshipQuery()

Inicializuje novou instanci RelationshipQuery třídy . Toto je konstruktor bez parametrů.

RelationshipQuery(String)

Inicializuje novou instanci RelationshipQuery třídy . Pokud zadaný řetězec lze úspěšně analyzovat jako dotaz WQL, je považován za řetězec dotazu; jinak se předpokládá, že je to cesta ke zdrojovému objektu dotazu. V tomto případě se předpokládá, že dotaz je dotaz na instance.

RelationshipQuery(String, String)

Inicializuje novou instanci RelationshipQuery třídy pro daný zdrojový objekt a třídu relace. Předpokládá se, že dotaz je dotaz instance (na rozdíl od dotazu schématu).

RelationshipQuery(Boolean, String, String, String, String)

Inicializuje novou instanci RelationshipQuery třídy pro dotaz schématu pomocí dané sady parametrů. Tento konstruktor se používá pouze pro dotazy schématu, takže první parametr musí být true.

RelationshipQuery(String, String, String, String, Boolean)

Inicializuje novou instanci RelationshipQuery třídy pro danou sadu parametrů. Předpokládá se, že dotaz je dotaz instance (na rozdíl od dotazu schématu).

RelationshipQuery()

Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs

Inicializuje novou instanci RelationshipQuery třídy . Toto je konstruktor bez parametrů.

public:
 RelationshipQuery();
public RelationshipQuery ();
Public Sub New ()

Poznámky

Zabezpečení rozhraní .NET Framework

Plná důvěra přímému volajícímu. Tento člen nemůže být použit částečně důvěryhodným kódem. Další informace najdete v tématu Použití knihoven z částečně důvěryhodného kódu.

Platí pro

RelationshipQuery(String)

Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs

Inicializuje novou instanci RelationshipQuery třídy . Pokud zadaný řetězec lze úspěšně analyzovat jako dotaz WQL, je považován za řetězec dotazu; jinak se předpokládá, že je to cesta ke zdrojovému objektu dotazu. V tomto případě se předpokládá, že dotaz je dotaz na instance.

public:
 RelationshipQuery(System::String ^ queryOrSourceObject);
public RelationshipQuery (string queryOrSourceObject);
new System.Management.RelationshipQuery : string -> System.Management.RelationshipQuery
Public Sub New (queryOrSourceObject As String)

Parametry

queryOrSourceObject
String

Řetězec dotazu nebo název třídy pro tento dotaz.

Příklady

Následující příklad nastaví typ relace mezi třídou služby WMI a RelatedObjectQuery.

using System;
using System.Management;

class Sample
{
    public static void Main(string[] args)
    {
        // Full query string is specified
        // to the constructor
        RelationshipQuery q =
            new RelationshipQuery(
            "references of {Win32_ComputerSystem.Name='mymachine'}");

        // Only the object of interest is
        // specified to the constructor
        RelationshipQuery query =
            new RelationshipQuery("Win32_Service.Name='Alerter'");
    }
}
Imports System.Management


Public Class Sample
    Public Overloads Shared Function _
        Main(ByVal args() As String) As Integer

        ' Full query string is specified
        ' to the constructor
        Dim q As New RelationshipQuery( _
            "references of {Win32_ComputerSystem.Name='mymachine'}")

        ' Only the object of interest is
        ' specified to the constructor
        Dim query As New RelationshipQuery( _
            "Win32_Service.Name='Alerter'")

    End Function
End Class

Poznámky

Zabezpečení rozhraní .NET Framework

Plná důvěra přímému volajícímu. Tento člen nemůže být použit částečně důvěryhodným kódem. Další informace najdete v tématu Použití knihoven z částečně důvěryhodného kódu.

Platí pro

RelationshipQuery(String, String)

Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs

Inicializuje novou instanci RelationshipQuery třídy pro daný zdrojový objekt a třídu relace. Předpokládá se, že dotaz je dotaz instance (na rozdíl od dotazu schématu).

public:
 RelationshipQuery(System::String ^ sourceObject, System::String ^ relationshipClass);
public RelationshipQuery (string sourceObject, string relationshipClass);
new System.Management.RelationshipQuery : string * string -> System.Management.RelationshipQuery
Public Sub New (sourceObject As String, relationshipClass As String)

Parametry

sourceObject
String

Cesta zdrojového objektu pro tento dotaz.

relationshipClass
String

Typ relace, na kterou se má dotazovat.

Poznámky

Zabezpečení rozhraní .NET Framework

Plná důvěra přímému volajícímu. Tento člen nemůže být použit částečně důvěryhodným kódem. Další informace najdete v tématu Použití knihoven z částečně důvěryhodného kódu.

Platí pro

RelationshipQuery(Boolean, String, String, String, String)

Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs

Inicializuje novou instanci RelationshipQuery třídy pro dotaz schématu pomocí dané sady parametrů. Tento konstruktor se používá pouze pro dotazy schématu, takže první parametr musí být true.

public:
 RelationshipQuery(bool isSchemaQuery, System::String ^ sourceObject, System::String ^ relationshipClass, System::String ^ relationshipQualifier, System::String ^ thisRole);
public RelationshipQuery (bool isSchemaQuery, string sourceObject, string relationshipClass, string relationshipQualifier, string thisRole);
new System.Management.RelationshipQuery : bool * string * string * string * string -> System.Management.RelationshipQuery
Public Sub New (isSchemaQuery As Boolean, sourceObject As String, relationshipClass As String, relationshipQualifier As String, thisRole As String)

Parametry

isSchemaQuery
Boolean

truechcete-li označit, že se jedná o dotaz schématu; v opačném případě . false

sourceObject
String

Cesta zdrojové třídy pro tento dotaz.

relationshipClass
String

Typ relace, na kterou se má dotazovat.

relationshipQualifier
String

Kvalifikátor musí být přítomný ve třídě relace.

thisRole
String

Role, kterou musí zdrojová třída hrát v relaci.

Poznámky

Zabezpečení rozhraní .NET Framework

Plná důvěra přímému volajícímu. Tento člen nemůže být použit částečně důvěryhodným kódem. Další informace najdete v tématu Použití knihoven z částečně důvěryhodného kódu.

Platí pro

RelationshipQuery(String, String, String, String, Boolean)

Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs
Zdroj:
ManagementQuery.cs

Inicializuje novou instanci RelationshipQuery třídy pro danou sadu parametrů. Předpokládá se, že dotaz je dotaz instance (na rozdíl od dotazu schématu).

public:
 RelationshipQuery(System::String ^ sourceObject, System::String ^ relationshipClass, System::String ^ relationshipQualifier, System::String ^ thisRole, bool classDefinitionsOnly);
public RelationshipQuery (string sourceObject, string relationshipClass, string relationshipQualifier, string thisRole, bool classDefinitionsOnly);
new System.Management.RelationshipQuery : string * string * string * string * bool -> System.Management.RelationshipQuery
Public Sub New (sourceObject As String, relationshipClass As String, relationshipQualifier As String, thisRole As String, classDefinitionsOnly As Boolean)

Parametry

sourceObject
String

Cesta zdrojového objektu pro tento dotaz.

relationshipClass
String

Typ relace, na kterou se má dotazovat.

relationshipQualifier
String

Kvalifikátor musí být přítomen u objektu relace.

thisRole
String

Role, kterou zdrojový objekt musí hrát v relaci.

classDefinitionsOnly
Boolean

Když tato metoda vrátí, obsahuje logickou hodnotu, která označuje, že jsou vráceny pouze definice třídy pro výsledné objekty.

Poznámky

Zabezpečení rozhraní .NET Framework

Plná důvěra přímému volajícímu. Tento člen nemůže být použit částečně důvěryhodným kódem. Další informace najdete v tématu Použití knihoven z částečně důvěryhodného kódu.

Platí pro