SalesBuy
1-855-856-7678
Technical SupportSupport
public ResultSegment<CloudBlobContainer> EndListContainersSegmented (
IAsyncResult asyncResult
)
public ResultSegment<CloudBlobContainer> EndListContainersSegmented ( IAsyncResult asyncResult )
public function EndListContainersSegmented ( asyncResult : IAsyncResult ) : ResultSegment<CloudBlobContainer>
Type: System.IAsyncResult
An IAsyncResult that references the pending asynchronous operation.
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.