导出 (0) 打印
全部展开

CloudBlobClient.EndListContainersSegmented 方法

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

命名空间: Microsoft.WindowsAzure.StorageClient
程序集: Microsoft.WindowsAzure.StorageClient(在 microsoft.windowsazure.storageclient.dll 中)

用法
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>

参数

asyncResult

An IAsyncResult that references the pending asynchronous operation.

返回值

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.


此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不保证所有实例成员都是线程安全的。

开发平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003、Windows Server 2008 和 Windows 2000

目标平台

社区附加资源

显示:
© 2014 Microsoft