Compartir a través de


ExchangeServiceBinding.FindFolderAsync Método

Definición

Sobrecargas

FindFolderAsync(FindFolderType)

El FindFolderAsync(FindFolderType) método proporciona acceso asincrónico al método de servicio web FindFolder.

FindFolderAsync(FindFolderType, Object)

El FindFolderAsync(FindFolderType, Object) método proporciona acceso asincrónico al método de servicio web FindFolder.

FindFolderAsync(FindFolderType)

El FindFolderAsync(FindFolderType) método proporciona acceso asincrónico al método de servicio web FindFolder.

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

Parámetros

FindFolder1
FindFolderType

La solicitud FindFolder.

Ejemplos

En el ejemplo siguiente se muestra cómo realizar una llamada a FindFolder asincrónica.

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;
}

Se aplica a

FindFolderAsync(FindFolderType, Object)

El FindFolderAsync(FindFolderType, Object) método proporciona acceso asincrónico al método de servicio 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

La solicitud FindFolder.

userState
Object

Comentarios

Para obtener un ejemplo de una llamada asincrónica, vea FindFolderAsync(FindFolderType).

Se aplica a