Compartilhar via


ExchangeServiceBinding.FindFolderAsync Método

Definição

Sobrecargas

FindFolderAsync(FindFolderType)

O FindFolderAsync(FindFolderType) método fornece acesso assíncrono ao método de serviço Web FindFolder.

FindFolderAsync(FindFolderType, Object)

O FindFolderAsync(FindFolderType, Object) método fornece acesso assíncrono ao método de serviço Web FindFolder.

FindFolderAsync(FindFolderType)

O FindFolderAsync(FindFolderType) método fornece acesso assíncrono ao método de serviço Web FindFolder.

public:
 void FindFolderAsync(ExchangeWebServices::FindFolderType ^ FindFolder1);
public void FindFolderAsync (ExchangeWebServices.FindFolderType FindFolder1);
Public Sub FindFolderAsync (FindFolder1 As FindFolderType)

Parâmetros

FindFolder1
FindFolderType

O pedido FindFolder.

Exemplos

O exemplo seguinte mostra como efetuar uma chamada FindFolder assíncrona.

static void FindFolderA(ExchangeServiceBinding <span class="label">esb</span>)
{ 
    // Register the event.
<span class="label">esb</span>.FindFolderCompleted += new FindFolderCompletedEventHandler(HandleFindFolderCompleted);

    // Create the request.
    FindFolderType request = new FindFolderType();
    request.FolderShape = new FolderResponseShapeType();
    request.FolderShape.BaseShape = DefaultShapeNamesType.AllProperties;
    request.Traversal = FolderQueryTraversalType.Deep;
    request.ParentFolderIds = new BaseFolderIdType[1];
    DistinguishedFolderIdType root = new DistinguishedFolderIdType();
    root.Id = DistinguishedFolderIdNameType.root;
    request.ParentFolderIds[0] = root;

    // Send the asynchronous request.
<span class="label">esb</span>.FindFolderAsync(request);

    // Wait for the response.
    while (!handled)
    {
        Thread.Sleep(1000);
        Console.Write("Waiting\r\n");
    }
}

static private bool handled = false;

static void HandleFindFolderCompleted(object sender, FindFolderCompletedEventArgs e)
{
    if ((!e.Cancelled) &amp;&amp; (e.Error == null))
    {
        FindFolderResponseType response = e.Result;
        // TODO: Handle the response.
    }
    handled = true;
}

Aplica-se a

FindFolderAsync(FindFolderType, Object)

O FindFolderAsync(FindFolderType, Object) método fornece acesso assíncrono ao método de serviço Web FindFolder.

public:
 void FindFolderAsync(ExchangeWebServices::FindFolderType ^ FindFolder1, System::Object ^ userState);
public void FindFolderAsync (ExchangeWebServices.FindFolderType FindFolder1, object userState);
Public Sub FindFolderAsync (FindFolder1 As FindFolderType, userState As Object)

Parâmetros

FindFolder1
FindFolderType

O pedido FindFolder.

userState
Object

Comentários

Para obter um exemplo de uma chamada assíncrona, consulte FindFolderAsync(FindFolderType).

Aplica-se a