내보내기(0) 인쇄
모두 확장

CloudBlob.FetchAttributes 메서드 (BlobRequestOptions)

Populates a blob's properties and metadata.

네임스페이스: Microsoft.WindowsAzure.StorageClient
어셈블리: Microsoft.WindowsAzure.StorageClient(microsoft.windowsazure.storageclient.dll)

‘사용 방법
Dim instance As CloudBlob
Dim options As BlobRequestOptions

instance.FetchAttributes(options)

‘선언
Public Sub FetchAttributes ( _
	options As BlobRequestOptions _
)
public void FetchAttributes (
	BlobRequestOptions options
)
public function FetchAttributes (
	options : BlobRequestOptions
)

매개 변수

options

An object that specifies any additional options for the request.

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()));
    }
}


The FetchAttributes method populates the blob's system properties and user-defined metadata. Before reading a blob's properties or metadata, you should always call this method or the BeginFetchAttributes method to retrieve the latest values for the blob's properties and metadata from the service.


이 형식의 모든 public static(Shared, Visual Basic의 경우) 멤버는 스레드로부터 안전합니다. 인터페이스 멤버는 스레드로부터 안전하지 않습니다.

개발 플랫폼

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

대상 플랫폼

커뮤니티 추가 항목

표시:
© 2014 Microsoft