2017-12-01 7 views

答えて

0

その可能ならば、私はちょうどそのコンテナ内のディレクトリに保存されたブロブに関するメタデータ を設定および取得する不思議でしたか?

はい、間違いなくそうすることができます。以下のサンプルコードを参照してください:

 const string ConnectionString = "DefaultEndpointsProtocol=https;AccountName=account-name;AccountKey=account-key"; 
     CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConnectionString); 

     //Create the service client object for credentialed access to the Blob service. 
     CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); 

     // Retrieve a reference to a container. 
     CloudBlobContainer container = blobClient.GetContainerReference("mycontainer"); 

     CloudBlockBlob blob = container.GetBlockBlobReference("images/logo.png"); 
     blob.FetchAttributes();//Gets the properties & metadata for the blob. 
     blob.Metadata.Add("Key", "Value"); 
     blob.SetMetadata();//Saves the metadata. 
+0

ありがとうございます!私はこの記事をもう一度チェックしてうれしいです。あなたが最初にそれが不可能であると言ったときに私は落胆しました。 –

+0

申し訳ありませんが....私の悪い!私は間違って投稿を読む。私はあなたがフォルダにメタデータを設定したいと思った。私は質問を読んだ後、私は間違いを認識し、私の答えを編集しました。それについて申し訳ありません! –

関連する問題