(0) exportieren Drucken
Alle erweitern
Dieser Artikel wurde noch nicht bewertet - Dieses Thema bewerten.

CloudBlockBlob.DownloadBlockList-Methode ()

Returns an enumerable collection of the committed blocks comprising the blob.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in microsoft.windowsazure.storageclient.dll)
'Usage
Dim instance As CloudBlockBlob
Dim returnValue As IEnumerable(Of ListBlockItem)

returnValue = instance.DownloadBlockList
public IEnumerable<ListBlockItem> DownloadBlockList ()
public IEnumerable<ListBlockItem> DownloadBlockList ()
public function DownloadBlockList () : IEnumerable<ListBlockItem>

Rückgabewert

An enumerable collection of objects implementing ListBlockItem.

The following code example downloads the block list for a blob and enumerates the blocks in the list. The example first downloads the committed blocks, then the uncommitted blocks, then the entire block list.

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

    //Get a reference to a block blob.
    CloudBlockBlob blockBlob = blobClient.GetBlockBlobReference("mycontainer/mybinaryblob.mp3");

    //Download the committed blocks in the block list.
    foreach (var blockListItem in blockBlob.DownloadBlockList())
    {
        Console.WriteLine("Block ID: " + blockListItem.Name);
        Console.WriteLine("Block size: " + blockListItem.Size);
        Console.WriteLine("Is block committed?: " + blockListItem.Committed);
        Console.WriteLine();
    }

    //Download only uncommitted blocks.
    foreach (var blockListItem in blockBlob.DownloadBlockList(BlockListingFilter.Uncommitted))
    {
        Console.WriteLine("Block ID: " + blockListItem.Name);
        Console.WriteLine("Block size: " + blockListItem.Size);
        Console.WriteLine("Is block committed?: " + blockListItem.Committed);
        Console.WriteLine();
    }

    //Download all blocks.
    foreach (var blockListItem in blockBlob.DownloadBlockList(BlockListingFilter.All))
    {
        Console.WriteLine("Block ID: " + blockListItem.Name);
        Console.WriteLine("Block size: " + blockListItem.Size);
        Console.WriteLine("Is block committed?: " + blockListItem.Committed);
        Console.WriteLine();
    }
}

The DownloadBlockList method downloads the list of committed blocks that comprise the blob. The committed block list includes the list of blocks that have been successfully committed to a blob.

The list of committed blocks is returned in the same order that they were committed to the blob. No block may appear more than once in the committed block list.


Alle öffentlichen statischen (freigegebenen in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Entwicklungsplattformen

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

Zielplattformen

Fanden Sie dies hilfreich?
(1500 verbleibende Zeichen)
Vielen Dank für Ihr Feedback.

Community-Beiträge

Microsoft führt eine Onlineumfrage durch, um Ihre Meinung zur MSDN-Website zu erfahren. Wenn Sie sich zur Teilnahme entscheiden, wird Ihnen die Onlineumfrage angezeigt, sobald Sie die MSDN-Website verlassen.

Möchten Sie an der Umfrage teilnehmen?
Anzeigen:
© 2014 Microsoft. Alle Rechte vorbehalten.