销售电话: 1-800-867-1380

CloudBlob.SetMetadata 方法 (BlobRequestOptions)

Updates the blob's metadata.

命名空间: Microsoft.WindowsAzure.StorageClient
程序集: Microsoft.WindowsAzure.StorageClient(在 microsoft.windowsazure.storageclient.dll 中)

用法
Dim instance As CloudBlob
Dim options As BlobRequestOptions

instance.SetMetadata(options)

public:
void SetMetadata (
	BlobRequestOptions^ options
)
public void SetMetadata (
	BlobRequestOptions options
)
public function SetMetadata (
	options : BlobRequestOptions
)

参数

options

An object that specifies any additional options for the request.

The following code example writes metadata to a blob.

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

    //Return a blob reference.
    CloudBlob blob = new CloudBlob("mycontainer/myblob.txt", blobClient);
    //Write some text to the blob.
    blob.UploadText("this is a text blob");

    //Define some metadata for the blob.
    blob.Metadata["category"] = "images";
    blob.Metadata["owner"] = "azureix";

    //Write the metadata to the service.
    blob.SetMetadata();
}


The SetMetadata method writes the metadata values that are specified by the blob's Metadata property to the service. Note that setting the Metadata property sets metadata values on the blob reference only; you must call BeginSetMetadata or SetMetadata to write them to the service.


此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不保证所有实例成员都是线程安全的。

开发平台

Windows XP Home Edition, Windows XP Professional, Windows Server 2003、Windows Server 2008 和 Windows 2000

目标平台

本文是否对您有所帮助?
(1500 个剩余字符)
感谢您的反馈

社区附加资源

显示:
© 2014 Microsoft