VENTAS: 1-800-867-1389

BlobAttributes.Metadata (Propiedad)

Gets the user-defined metadata for the blob.

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

'Uso
Dim instance As BlobAttributes
Dim value As NameValueCollection

value = instance.Metadata

public NameValueCollection Metadata { get; }
/** @property */
/** @attribute CompilerGeneratedAttribute() */ 
public NameValueCollection get_Metadata ()

CompilerGeneratedAttribute 
public function get Metadata () : NameValueCollection

Valor de propiedad

The blob's metadata, as a collection of name-value pairs.

The following code example lists blob properties and metadata.

static void ListBlobPropertiesAndMetadata(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));

    //Get a reference to a blob.
    CloudBlob blob = blobClient.GetBlobReference("mycontainer/myblob.txt");

    //Populate the blob's attributes.
    blob.FetchAttributes();

    //List some blob properties.
    Console.WriteLine("Blob: " + blob.Attributes.Uri);
    Console.WriteLine();

    Console.WriteLine("Blob properties:");
    Console.WriteLine("\tBlobType: " + blob.Attributes.Properties.BlobType);
    Console.WriteLine("\tLastModifiedUTC: " + blob.Attributes.Properties.LastModifiedUtc);
    Console.WriteLine("\tETag: " + blob.Attributes.Properties.ETag);
    Console.WriteLine();

    //Enumerate the blob's metadata.
    foreach (var metadataKey in blob.Metadata.Keys)
    {
        Console.WriteLine("Metadata name: " + metadataKey.ToString());
        Console.WriteLine("Metadata value: " + blob.Metadata.Get(metadataKey.ToString()));
    }
}


Returning a reference to a blob does not automatically provide access to the blob's metadata. To populate a blob's metadata, call the FetchAttributes method or the BeginFetchAttributes and EndFetchAttributes methods. Calling these methods before reading a blob's metadata will ensure that the metadata values are up-to-date.


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

¿Te ha resultado útil?
(Caracteres restantes: 1500)
Gracias por sus comentarios

Adiciones de comunidad

Mostrar:
© 2014 Microsoft