共用方式為


CimSession.SubscribeAsync Method (String, String, String, CimOperationOptions, CimSubscriptionDeliveryOptions)

 

Asynchronous method that subscribes to an indication on the server represented by the session.

Namespace:   Microsoft.Management.Infrastructure
Assembly:  Microsoft.Management.Infrastructure (in Microsoft.Management.Infrastructure.dll)

Syntax

public CimAsyncMultipleResults<CimSubscriptionResult> SubscribeAsync(
    string namespaceName,
    string queryDialect,
    string queryExpression,
    CimOperationOptions operationOptions,
    CimSubscriptionDeliveryOptions options
)
public:
CimAsyncMultipleResults<CimSubscriptionResult^>^ SubscribeAsync(
    String^ namespaceName,
    String^ queryDialect,
    String^ queryExpression,
    CimOperationOptions^ operationOptions,
    CimSubscriptionDeliveryOptions^ options
)
member SubscribeAsync : 
        namespaceName:string *
        queryDialect:string *
        queryExpression:string *
        operationOptions:CimOperationOptions *
        options:CimSubscriptionDeliveryOptions -> CimAsyncMultipleResults<CimSubscriptionResult>
Public Function SubscribeAsync (
    namespaceName As String,
    queryDialect As String,
    queryExpression As String,
    operationOptions As CimOperationOptions,
    options As CimSubscriptionDeliveryOptions
) As CimAsyncMultipleResults(Of CimSubscriptionResult)

Parameters

  • namespaceName
    Type: System.String

    A null-terminated string that contains the optional namespace name to carry out the operation. If none is specified, the server will pick a default. The namespace cannot include a computer name. It can only be in the form of a namespace name separated by a slash mark character (/). For example, the following would be a valid namespaceName value: root/cimv2.

  • queryDialect
    Type: System.String

    A string that contains the dialect of the query being passed. This value can be either WQL or CQL. Note that some servers do not support all query types.

  • queryExpression
    Type: System.String

    A string that contains the query expression to be carried out. Usually a query is needed, but if a WS-Management endpoint is being used, a resource URI can be passed. For WMI DCOM transport, this value must be specified.

Return Value

Type: Microsoft.Management.Infrastructure.Generic.CimAsyncMultipleResults<CimSubscriptionResult>

A CimAsyncMultipleResults<T> object that represents an asynchronous operation that returns multiple results.

See Also

SubscribeAsync Overload
CimSession Class
Microsoft.Management.Infrastructure Namespace

Return to top