导出 (0) 打印
全部展开
此主题尚未评级 - 评价此主题

CloudBlobContainer.SetMetadata 方法 ()

Sets the container's user-defined metadata.

命名空间: Microsoft.WindowsAzure.StorageClient
程序集: Microsoft.WindowsAzure.StorageClient(在 microsoft.windowsazure.storageclient.dll 中)
用法
Dim instance As CloudBlobContainer

instance.SetMetadata
public void SetMetadata ()
public void SetMetadata ()
public function SetMetadata ()

The following code example defines some metadata for a container and writes it to the container.

static void WriteContainerMetadata(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 container reference.
    CloudBlobContainer container = new CloudBlobContainer("mycontainer", blobClient);

    //Create the container if it does not exist.
    container.CreateIfNotExist();

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

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


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

You can also set metadata on a container when the container is created, without calling SetMetadata.


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

开发平台

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

目标平台

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

社区附加资源

显示:
© 2014 Microsoft. 版权所有。