Exportar (0) Imprimir
Expandir Tudo
EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

CloudBlobClient.GetBlobReference Method (String)

Updated: April 24, 2011

[This topic is part of the Microsoft Azure Storage Client Library 1.7, which has been deprecated. See Storage Client Library for the latest version.]

Returns a reference to a CloudBlob with the specified address.

Namespace: Microsoft.WindowsAzure.StorageClient
Assembly: Microsoft.WindowsAzure.StorageClient (in Microsoft.WindowsAzure.StorageClient.dll)

'Uso
Dim instance As CloudBlobClient
Dim blobAddress As String
Dim returnValue As CloudBlob

returnValue = instance.GetBlobReference(blobAddress)

public CloudBlob GetBlobReference (
	string blobAddress
)

Parameters

blobAddress

Type: System.String

The absolute URI to the blob, or a relative URI beginning with the container name.

Return Value

Type: Microsoft.WindowsAzure.StorageClient.CloudBlob

A reference to a blob.

The following example shows two ways to call the GetBlobReference method.


//Get a reference to a blob using a relative address.
CloudBlob publicBlob = publicClient.GetBlobReference("mypubliccontainer/publicBlob.txt");

//Get a reference to a blob using an absolute address.
CloudBlob publicBlob = publicClient.GetBlobReference("https://storagesample.blob.core.windows.net/mypubliccontainer/publicBlob.txt");

The GetBlobReference method returns a reference to the named blob, but it does not indicate whether the blob exists, as it does not make a round-trip to the service. If you need to ascertain the blob's existence, call a method such as FetchAttributes, and handle the resulting StorageClientException in the event the blob does not exist. The FetchAttributes method executes a HEAD request to populate the blob's properties and metadata and as such is a lightweight option for determining whether the blob exists.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

 

Reference

CloudBlobClient Class
CloudBlobClient Members
Microsoft.WindowsAzure.StorageClient Namespace

Other Resources

Naming and Referencing Containers, Blobs, and Metadata

Mostrar:
© 2014 Microsoft