Exportar (0) Imprimir
Expandir todo

CloudBlobClient.EndListContainersSegmented (Método)

Ends an asynchronous operation to return a result segment containing a collection of containers.

Espacio de nombres: Microsoft.WindowsAzure.StorageClient
Ensamblado: Microsoft.WindowsAzure.StorageClient (en microsoft.windowsazure.storageclient.dll)

'Uso
Dim instance As CloudBlobClient
Dim asyncResult As IAsyncResult
Dim returnValue As ResultSegment(Of CloudBlobContainer)

returnValue = instance.EndListContainersSegmented(asyncResult)

public ResultSegment<CloudBlobContainer> EndListContainersSegmented (
	IAsyncResult asyncResult
)
public ResultSegment<CloudBlobContainer> EndListContainersSegmented (
	IAsyncResult asyncResult
)
public function EndListContainersSegmented (
	asyncResult : IAsyncResult
) : ResultSegment<CloudBlobContainer>

Parámetros

asyncResult

An IAsyncResult that references the pending asynchronous operation.

Valor devuelto

A result segment of containers.

The following code sample lists containers in the storage account asynchronously, in result segments of ten containers at a time.

static void ListContainersInSegmentsAsynchronously(Uri blobEndpoint, string accountName, string accountKey)
{
    //Create service client for credentialed access to the Blob service.
    CloudBlobClient blobClient = new CloudBlobClient(blobEndpoint, new StorageCredentialsAccountAndKey(accountName, accountKey));

    //Begin the operation to return the first segment of 10 containers in the account.
    blobClient.BeginListContainersSegmented("", ContainerListingDetails.None, 10, null, ListContainersInSegmentsCallback, blobClient);
}

static void ListContainersInSegmentsCallback(IAsyncResult result)
{
    CloudBlobClient blobClient = (CloudBlobClient)result.AsyncState;
    ResultSegment<CloudBlobContainer> resultSegment = blobClient.EndListContainersSegmented(result);

    //Enumerate the containers.
    foreach (var container in resultSegment.Results)
    {
        Console.WriteLine(container.Name);
    }

    //Check whether the page is complete.
    if (resultSegment.HasMoreResults)
    {
        resultSegment = resultSegment.GetNext();

        //Enumerate the containers.
        foreach (var container in resultSegment.Results)
        {
            Console.WriteLine(container.Name);
        }
    }
}


This method blocks until the listing operation is complete.


Cualquier miembro estático público (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas de desarrollo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 y Windows 2000

Plataformas de destino

Adiciones de comunidad

Mostrar:
© 2014 Microsoft